summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:06:36 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:06:36 +0100
commitcb5ace803d07b9bd7dc15299d9bc830eb887adf9 (patch)
tree7d68904a33c6dee0e2ab9d581c1f77f752d41278 /src
parent90ee43b235b88c82839cc3e46fa37a1a2686d1ea (diff)
fidentify: Fix memory leak in error path reported by Coverity scan
Diffstat (limited to 'src')
-rw-r--r--src/fidentify.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fidentify.c b/src/fidentify.c
index 56f642f..3f09d51 100644
--- a/src/fidentify.c
+++ b/src/fidentify.c
@@ -73,7 +73,10 @@ static int file_identify(const char *filename, const unsigned int check)
buffer=buffer_olddata + blocksize;
file=fopen(filename, "rb");
if(file==NULL)
+ {
+ free(buffer_start);
return -1;
+ }
if(fread(buffer, 1, READ_SIZE, file)<=0)
{
fclose(file);