Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libclamav/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ void clamav_stats_add_sample(const char *virname, const unsigned char *md5, size
;
p = realloc(sample->virus_name, sizeof(char **) * (i + 1));
if (!(p)) {
for (i = 0; sample->virus_name[i] != NULL; i++)
free(sample->virus_name[i]);
free(sample->virus_name);
free(sample);
if (sample == intel->samples)
Expand All @@ -231,6 +233,8 @@ void clamav_stats_add_sample(const char *virname, const unsigned char *md5, size

sample->virus_name[i] = strdup((virname != NULL) ? virname : "[unknown]");
if (!(sample->virus_name[i])) {
for (i = 0; sample->virus_name[i] != NULL; i++)
free(sample->virus_name[i]);
free(sample->virus_name);
free(sample);
if (sample == intel->samples)
Expand All @@ -241,6 +245,8 @@ void clamav_stats_add_sample(const char *virname, const unsigned char *md5, size

p = realloc(sample->virus_name, sizeof(char **) * (i + 2));
if (!(p)) {
for (i = 0; sample->virus_name[i] != NULL; i++)
free(sample->virus_name[i]);
Comment on lines +248 to +249
free(sample->virus_name);
free(sample);
if (sample == intel->samples)
Expand Down
2 changes: 1 addition & 1 deletion libclamav/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ textAddMessage(text *aText, message *aMessage)

if (aText) {
text *newHead = textMove(aText, anotherText);
free(anotherText);
textDestroy(anotherText);
return newHead;
}
return anotherText;
Expand Down
Loading