From 8566034866615f1acee6f3ed447ca88f01105b2e Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Mon, 20 Jul 2015 13:41:36 +1000 Subject: [PATCH] pacman/files.c: fix memory leak on regex error Signed-off-by: Allan McRae --- src/pacman/files.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pacman/files.c b/src/pacman/files.c index 22509943..ceec3429 100644 --- a/src/pacman/files.c +++ b/src/pacman/files.c @@ -102,6 +102,7 @@ static int files_search(alpm_list_t *syncs, alpm_list_t *targets, int regex) { if(regex) { if(regcomp(®, targ, REG_EXTENDED | REG_NOSUB | REG_ICASE | REG_NEWLINE) != 0) { /* TODO: error message */ + free(targ); goto notfound; } }