diff stream/network.c @ 21535:94ac700b2898

Close fd on error.
author reimar
date Sat, 09 Dec 2006 18:54:12 +0000
parents e7f56cc4505e
children 853c5dbaa91e
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);