Close fd on error.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21551 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2006-12-09 18:54:12 +00:00
parent d24e49b53d
commit 5adaad47de
1 changed files with 2 additions and 1 deletions

View File

@ -178,7 +178,7 @@ http_send_request( URL_t *url, off_t pos ) {
HTTP_header_t *http_hdr;
URL_t *server_url;
char str[256];
int fd;
int fd = -1;
int ret;
int proxy = 0; // Boolean
@ -245,6 +245,7 @@ http_send_request( URL_t *url, off_t pos ) {
return fd;
err_out:
if (fd > 0) closesocket(fd);
http_free(http_hdr);
if (proxy && server_url)
url_free(server_url);