* [B.A.T.M.A.N.] [PATCH] batadv-vis: Avoid file handler leak after failed realloc
@ 2014-05-27 15:04 Sven Eckelmann
2014-05-27 17:11 ` Simon Wunderlich
0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2014-05-27 15:04 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Sven Eckelmann
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@narfation.org>
---
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;
}
--
2.0.0.rc4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batadv-vis: Avoid file handler leak after failed realloc
2014-05-27 15:04 [B.A.T.M.A.N.] [PATCH] batadv-vis: Avoid file handler leak after failed realloc Sven Eckelmann
@ 2014-05-27 17:11 ` Simon Wunderlich
0 siblings, 0 replies; 2+ messages in thread
From: Simon Wunderlich @ 2014-05-27 17:11 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Sven Eckelmann
> 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").
>
Applied in revision 3b72283
Thanks,
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-27 17:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-27 15:04 [B.A.T.M.A.N.] [PATCH] batadv-vis: Avoid file handler leak after failed realloc Sven Eckelmann
2014-05-27 17:11 ` Simon Wunderlich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox