changeset 21535:94ac700b2898

Close fd on error.
author reimar
date Sat, 09 Dec 2006 18:54:12 +0000
parents 6bee9fab79f6
children 4d1ba1f391f3
files stream/network.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/network.c	Sat Dec 09 18:09:41 2006 +0000
+++ b/stream/network.c	Sat Dec 09 18:54:12 2006 +0000
@@ -178,7 +178,7 @@
 	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 @@
 
 	return fd;
 err_out:
+	if (fd > 0) closesocket(fd);
 	http_free(http_hdr);
 	if (proxy && server_url)
 		url_free(server_url);