Browse code

fix bug in memory management

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@672 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/07/16 09:34:56
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Fri Jul 16 02:30:03 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav: fix bug in memory management (thanks to Nigel)
4
+
1 5
 Fri Jul 16 00:38:46 CEST 2004 (tk)
2 6
 ----------------------------------
3 7
   * libclamav: pe: do not report I/O error on bad e_lfanew's
... ...
@@ -91,7 +91,7 @@ static int cli_addsig(struct cl_node *root, const char *virname, const char *hex
91 91
 	    new->alt++;
92 92
 	    new->altn = (unsigned short int *) realloc(new->altn, new->alt * sizeof(unsigned short int));
93 93
 	    new->altn[new->alt - 1] = 0;
94
-	    new->altc = (char **) realloc(new->altc, new->alt);
94
+	    new->altc = (char **) realloc(new->altc, new->alt * sizeof(char *));
95 95
 
96 96
 	    for(i = 0; i < strlen(pt); i++)
97 97
 		if(pt[i] == '|')