summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:18:30 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:18:30 +0100
commit2237a01ed0065e6e9f4fa70d59a76a8acc8f42aa (patch)
tree54cee81a5627afd7fd4bdbf66fdadc15be895d59 /src
parent971d0b8f4a9dd49f8a070bf0b83b3320f49fad69 (diff)
src/file_sig.c: fix memory leak in error paths
Diffstat (limited to 'src')
-rw-r--r--src/file_sig.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/file_sig.c b/src/file_sig.c
index 0a87831..820390d 100644
--- a/src/file_sig.c
+++ b/src/file_sig.c
@@ -242,6 +242,7 @@ static char *parse_signature_file(file_stat_t *file_stat, char *pos)
if(*pos=='\0')
{
free(extension);
+ free(tmp);
return pos;
}
else if(*pos=='\\')
@@ -250,6 +251,7 @@ static char *parse_signature_file(file_stat_t *file_stat, char *pos)
if(*pos=='\0')
{
free(extension);
+ free(tmp);
return pos;
}
else if(*pos=='b')
@@ -274,6 +276,7 @@ static char *parse_signature_file(file_stat_t *file_stat, char *pos)
if(*pos!='\'')
{
free(extension);
+ free(tmp);
return pos;
}
pos++;
@@ -301,6 +304,7 @@ static char *parse_signature_file(file_stat_t *file_stat, char *pos)
if(*pos=='\0')
{
free(extension);
+ free(tmp);
return pos;
}
else if(*pos=='b')
@@ -322,6 +326,7 @@ static char *parse_signature_file(file_stat_t *file_stat, char *pos)
if(*pos!='"')
{
free(extension);
+ free(tmp);
return pos;
}
pos++;
@@ -354,6 +359,7 @@ static char *parse_signature_file(file_stat_t *file_stat, char *pos)
else
{
free(extension);
+ free(tmp);
return pos;
}
}
@@ -398,6 +404,7 @@ static void register_header_check_sig(file_stat_t *file_stat)
if(fread(buffer,1,buffer_size,handle)!=buffer_size)
{
fclose(handle);
+ free(buffer);
return;
}
fclose(handle);