git-svn: trunk@3433
aCaB authored on 2007/12/19 01:32:52... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Tue Dec 18 16:52:54 CET 2007 (acab) |
|
2 |
+----------------------------------- |
|
3 |
+ * libclamav/unzip.c: Fix mmap leaks if tempfile fails |
|
4 |
+ |
|
1 | 5 |
Tue Dec 18 13:52:40 GMT 2007 (njh) |
2 | 6 |
---------------------------------- |
3 | 7 |
* libclamav, sigtool: Add consistency to function names in the VBA module |
... | ... |
@@ -479,10 +479,13 @@ int cli_unzip(int f, cli_ctx *ctx) { |
479 | 479 |
return CL_EMEM; |
480 | 480 |
} |
481 | 481 |
|
482 |
- if (!(tmpd = cli_gentemp(NULL))) |
|
482 |
+ if (!(tmpd = cli_gentemp(NULL))) { |
|
483 |
+ munmap(map, fsize); |
|
483 | 484 |
return CL_ETMPDIR; |
485 |
+ } |
|
484 | 486 |
if (mkdir(tmpd, 0700)) { |
485 | 487 |
cli_dbgmsg("cli_unzip: Can't create temporary directory %s\n", tmpd); |
488 |
+ munmap(map, fsize); |
|
486 | 489 |
free(tmpd); |
487 | 490 |
return CL_ETMPDIR; |
488 | 491 |
} |