batadv-vis: Avoid file handler leak after failed realloc
PATCH 1/1 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 <[email protected]>
--- vis/vis.c | 1 + 1 file changed, 1 insertion(+)
vis/vis.c +1 -0
@@ -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 ; }
Signature · 1 line
2.0.0.rc4
Simon Wunderlich
AppliedQuoted 5 lines
The
read_filefunction opens the file and thus has to close the filehandler after an realloc error. This was forgotten in the fix0ad384e11ed039d4c3025a7eaf19fe6bcfd41acf("batadv-vis: Avoid memory leak after failed realloc").
Applied in revision 3b72283
Thanks,
Simon