Browse code

freshclam: fix memleak when testing safebrowsing.cvd (bb#2091)

Tomasz Kojm authored on 2010/06/29 20:51:59
Showing 5 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Jun 29 13:51:06 CEST 2010 (tk)
2
+----------------------------------
3
+ * freshclam: fix memleak when testing safebrowsing.cvd (bb#2091)
4
+
1 5
 Tue Jun 29 12:08:42 EEST 2010 (edwin)
2 6
 -------------------------------------
3 7
  * libclamav/mpool.c: reduce memory waste due to alignment (~14% improvement).
... ...
@@ -77,6 +77,7 @@
77 77
 #include "libclamav/others.h"
78 78
 #include "libclamav/str.h"
79 79
 #include "libclamav/cvd.h"
80
+#include "libclamav/regex_list.h"
80 81
 
81 82
 extern char updtmpdir[512];
82 83
 
... ...
@@ -1774,6 +1775,8 @@ static int updatedb(const char *dbname, const char *hostname, char *ip, int *sig
1774 1774
 	    return 55;
1775 1775
 	}
1776 1776
 	logg("*Properly loaded %u signatures from new %s\n", newsigs, newdb);
1777
+	if(engine->domainlist_matcher && engine->domainlist_matcher->sha256_pfx_set.keys)
1778
+	    cli_hashset_destroy(&engine->domainlist_matcher->sha256_pfx_set);
1777 1779
 	cl_engine_free(engine);
1778 1780
     }
1779 1781
 
... ...
@@ -97,6 +97,7 @@ CLAMAV_PRIVATE {
97 97
     regex_list_add_pattern;
98 98
     cli_build_regex_list;
99 99
     regex_list_match;
100
+    cli_hashset_destroy;
100 101
     phishing_init;
101 102
     init_domainlist;
102 103
     init_whitelist;
... ...
@@ -28,6 +28,7 @@
28 28
 #include "readdb.h"
29 29
 #include "matcher.h"
30 30
 #include "filtering.h"
31
+#include "hashtab.h"
31 32
 #include <zlib.h> /* for gzFile */
32 33
 
33 34
 #include "mpool.h"
... ...
@@ -502,7 +502,7 @@
502 502
 /* #undef USE_SYSLOG */
503 503
 
504 504
 /* Version number of package */
505
-#define VERSION "devel-clamav-0.96-177-g44712fc"
505
+#define VERSION "devel-clamav-0.96-186-g5f12eac"
506 506
 
507 507
 /* Version suffix for package */
508 508
 #define VERSION_SUFFIX ""