From fa19def3a145865a1852591fc0a47122b03b3ccf Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Tue, 11 Oct 2011 04:40:50 +0000 Subject: Some more error handling (re #1384: HTTP client source port range) git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3811 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib-util/src/pjlib-util/http_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pjlib-util') diff --git a/pjlib-util/src/pjlib-util/http_client.c b/pjlib-util/src/pjlib-util/http_client.c index d92db1e3..cf96a2df 100644 --- a/pjlib-util/src/pjlib-util/http_client.c +++ b/pjlib-util/src/pjlib-util/http_client.c @@ -1073,6 +1073,7 @@ static pj_status_t start_http_req(pj_http_req *http_req, if (status != PJ_SUCCESS) { PJ_PERROR(1,(THIS_FILE, status, "Unable to bind to the requested port")); + pj_sock_close(sock); goto on_return; } @@ -1082,8 +1083,7 @@ static pj_status_t start_http_req(pj_http_req *http_req, NULL, http_req->ioqueue, &asock_cb, http_req, &http_req->asock); if (status != PJ_SUCCESS) { - if (sock != PJ_INVALID_SOCKET) - pj_sock_close(sock); + pj_sock_close(sock); goto on_return; // error creating activesock } -- cgit v1.2.3