Browse code

fix leaking virusnames in hm_free

aCaB authored on 2011/02/04 00:47:47
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Feb  3 16:40:24 CET 2011 (acab)
2
+-----------------------------------
3
+ * libclamav/matcher-hash.c: stop leaking virusnames (nopool mode)
4
+
1 5
 Mon Jan 31 16:53:39 CET 2011 (tk)
2 6
 ---------------------------------
3 7
  * V 0.97rc
... ...
@@ -256,6 +256,8 @@ void hm_free(struct cli_matcher *root) {
256 256
 	    unsigned int keylen = hashlen[type];
257 257
 
258 258
 	    mpool_free(root->mempool, szh->hash_array);
259
+	    while(szh->items)
260
+		mpool_free(root->mempool, szh->virusnames[--szh->items]);
259 261
 	    mpool_free(root->mempool, szh->virusnames);
260 262
 	    mpool_free(root->mempool, szh);
261 263
 	}