Return-Path: From: Sven Eckelmann Date: Tue, 27 May 2014 17:04:15 +0200 Message-Id: <1401203055-22240-1-git-send-email-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH] batadv-vis: Avoid file handler leak after failed realloc Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: b.a.t.m.a.n@lists.open-mesh.org 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 --- 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