comparison stream/network.c @ 21535:94ac700b2898

Close fd on error.
author reimar
date Sat, 09 Dec 2006 18:54:12 +0000
parents e7f56cc4505e
children 853c5dbaa91e
comparison
equal deleted inserted replaced
21534:6bee9fab79f6 21535:94ac700b2898
176 int 176 int
177 http_send_request( URL_t *url, off_t pos ) { 177 http_send_request( URL_t *url, off_t pos ) {
178 HTTP_header_t *http_hdr; 178 HTTP_header_t *http_hdr;
179 URL_t *server_url; 179 URL_t *server_url;
180 char str[256]; 180 char str[256];
181 int fd; 181 int fd = -1;
182 int ret; 182 int ret;
183 int proxy = 0; // Boolean 183 int proxy = 0; // Boolean
184 184
185 http_hdr = http_new_header(); 185 http_hdr = http_new_header();
186 186
243 243
244 http_free( http_hdr ); 244 http_free( http_hdr );
245 245
246 return fd; 246 return fd;
247 err_out: 247 err_out:
248 if (fd > 0) closesocket(fd);
248 http_free(http_hdr); 249 http_free(http_hdr);
249 if (proxy && server_url) 250 if (proxy && server_url)
250 url_free(server_url); 251 url_free(server_url);
251 return -1; 252 return -1;
252 } 253 }