Browse code

fix socket descriptor leak in --no-dns mode

git-svn: trunk@1530

Tomasz Kojm authored on 2005/05/11 10:35:42
Showing 3 changed files
... ...
@@ -169,6 +169,7 @@ David Santinoli <david*santinoli.com>
169 169
 Vijay Sarvepalli <vssarvep*office.uncg.edu>
170 170
 Theo Schlossnagle <jesus*omniti.com>
171 171
 Matthew Seaman <m.seaman*infracaninophile.co.uk>
172
+GertJan Spoelman <cav*gjs.cc>
172 173
 Sven Strickroth <sstrickroth*gym-oha.de>
173 174
 Matt Sullivan <matt*sullivan.gen.nz>
174 175
 Joe Talbott <josepht*cstone.net>
... ...
@@ -1,3 +1,8 @@
1
+Wed May 11 03:29:50 CEST 2005 (tk)
2
+----------------------------------
3
+  * freshclam/manager.c: fix socket descriptor leak in --no-dns mode (patch by
4
+			 GertJan Spoelman <cav*gjs.cc>)
5
+
1 6
 Wed May 11 02:44:41 CEST 2005 (tk)
2 7
 ----------------------------------
3 8
   * clamscan, freshclam: return with 62 (instead of 1) when logger can't be
... ...
@@ -313,6 +313,7 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna
313 313
 	    mprintf("%s is up to date (version: %d, sigs: %d, f-level: %d, builder: %s)\n", localname, current->version, current->sigs, current->fl, current->builder);
314 314
 	    logg("%s is up to date (version: %d, sigs: %d, f-level: %d, builder: %s)\n", localname, current->version, current->sigs, current->fl, current->builder);
315 315
 	    *signo += current->sigs;
316
+	    close(hostfd);
316 317
 	    cl_cvdfree(current);
317 318
 	    return 1;
318 319
 	}
... ...
@@ -345,6 +346,7 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna
345 345
 	}
346 346
 
347 347
 	*signo += current->sigs;
348
+	close(hostfd);
348 349
 	cl_cvdfree(current);
349 350
 	return 1;
350 351
     }