Browse code

fix error path descriptor leak

git-svn: trunk@2594

Tomasz Kojm authored on 2007/01/07 22:53:33
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sun Jan  7 14:51:56 CET 2007 (tk)
2
+---------------------------------
3
+  * freshclam/manager.c: fix error path descriptor leak, spotted by NJH
4
+
1 5
 Sun Jan  7 01:24:21 CET 2007 (tk)
2 6
 ---------------------------------
3 7
   * libclamav/unzip.c: improve handling of archives with unusual headers
... ...
@@ -573,6 +573,7 @@ static int getfile(const char *srcfile, const char *destfile, const char *hostna
573 573
        !strstr(buffer, "HTTP/1.1 206") && !strstr(buffer, "HTTP/1.0 206")) {
574 574
 	logg("!getfile: Unknown response from remote server (IP: %s)\n", ipaddr);
575 575
 	mirman_update(mdat->currip, mdat, 1);
576
+	close(sd);
576 577
 	return 58;
577 578
     }
578 579