Repository : ssh://git@open-mesh.org/alfred
On branch : master
---------------------------------------------------------------
commit 3b722834d20a846594240d6f91706d44cf137bf4
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Tue May 27 17:04:15 2014 +0200
batadv-vis: Avoid file handler leak after failed realloc
The read_file function opens the file and thus has to close the filehandler
after an realloc error. This was forgotten in the fix
0ad384e11ed039d4c3025a7eaf19fe6bcfd41acf ("batadv-vis: Avoid memory leak after
failed realloc").
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de>
---------------------------------------------------------------
3b722834d20a846594240d6f91706d44cf137bf4
vis/vis.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/vis/vis.c b/vis/vis.c
index f429942..55c2dad 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -56,6 +56,7 @@ static char *read_file(char *fname)
buf_tmp = realloc(buf, size + 4097);
if (!buf_tmp) {
free(buf);
+ fclose(fp);
return NULL;
}