From b6384d233e300d42d5d39a39ff2c51f3419de639 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 3 Apr 2016 17:43:19 +0100 Subject: [PATCH] lib: avoid double free in loopdev.c Found with scan-build. Reviewed-by: Yuriy M. Kaminskiy Signed-off-by: Sami Kerola --- lib/loopdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/loopdev.c b/lib/loopdev.c index 9ae61daa95..26c183e8d6 100644 --- a/lib/loopdev.c +++ b/lib/loopdev.c @@ -460,6 +460,7 @@ static int loop_scandir(const char *dirname, int **ary, int hasprefix) tmp = realloc(*ary, arylen * sizeof(int)); if (!tmp) { free(*ary); + *ary = NULL; closedir(dir); return -1; } -- 2.47.2