Browse code

make hashtab_clear properly clear the table

aCaB authored on 2011/01/06 22:54:12
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Jan  6 14:52:38 CET 2011 (acab)
2
+-----------------------------------
3
+ * libclamav/hashtab.c: properly clear the table
4
+
1 5
 Mon Jan  3 17:10:03 CET 2011 (tk)
2 6
 ---------------------------------
3 7
  * freshclam/manager.c: fix version warning (bb#2456)
... ...
@@ -367,7 +367,7 @@ void cli_hashtab_clear(struct cli_hashtable *s)
367 367
 			free((void *)s->htable[i].key);
368 368
 	}
369 369
 	if(s->htable)
370
-		memset(s->htable, 0, s->capacity);
370
+		memset(s->htable, 0, s->capacity * sizeof(*s->htable));
371 371
 	s->used = 0;
372 372
 }
373 373