[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

aCaB acab at clamav.net
Sun Apr 4 01:14:05 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 60b2125135b8098bd2b89c9aafa8ac2385918c61
Author: aCaB <acab at clamav.net>
Date:   Tue Jan 5 18:15:59 2010 +0100

    fix clamav-config include, properly restore fmap - thx edwin for the spot!

diff --git a/libclamav/cache.c b/libclamav/cache.c
index ba53d74..290b212 100644
--- a/libclamav/cache.c
+++ b/libclamav/cache.c
@@ -2,16 +2,16 @@
 #include <stdlib.h>
 #include <pthread.h>
 
+#if HAVE_CONFIG_H
+#include "clamav-config.h"
+#endif
+
 #include "md5.h"
 #include "mpool.h"
 #include "clamav.h"
 #include "cache.h"
 #include "fmap.h"
 
-#if HAVE_CONFIG_H
-#include "clamav-config.h"
-#endif
-
 #define CACHE_PERTURB 10
 /* 1/10th */
 
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index 4d8f05d..de6af02 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -1874,11 +1874,15 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
     ctx->fmap++;
     if(!(*ctx->fmap = fmap(desc, 0, sb.st_size))) {
 	cli_errmsg("CRITICAL: fmap() failed\n");
+	ctx->fmap--;
 	return CL_EMEM;
     }
 
-    if(cache_check(hash, ctx) == CL_CLEAN)
+    if(cache_check(hash, ctx) == CL_CLEAN) {
+	funmap(*ctx->fmap);
+	ctx->fmap--;
 	return CL_CLEAN;
+    }
     
     if(!ctx->options || (ctx->recursion == ctx->engine->maxreclevel)) { /* raw mode (stdin, etc.) or last level of recursion */
 	if(ctx->recursion == ctx->engine->maxreclevel)

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list