lib: avoid double free in loopdev.c

Found with scan-build.

Reviewed-by: Yuriy M. Kaminskiy <yumkam@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2016-04-03 17:43:19 +01:00
parent 31af559e30
commit 34f6177a24
No known key found for this signature in database
GPG Key ID: A9553245FDE9B739
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}