From: Francois Berder Date: Sun, 12 Nov 2023 19:16:50 +0000 (+0100) Subject: lib/slre: Fix memory leak if regex compilation fails X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=891b178c579c0084c1759cf0319e7151a7e288a5;p=u-boot.git lib/slre: Fix memory leak if regex compilation fails Signed-off-by: Francois Berder --- diff --git a/lib/slre.c b/lib/slre.c index e82a9e7635..e1a50443e0 100644 --- a/lib/slre.c +++ b/lib/slre.c @@ -686,6 +686,7 @@ int main(int argc, char *argv[]) } if (!slre_compile(&slre, argv[1])) { + (void) fclose(fp); fprintf(stderr, "Error compiling slre: %s\n", slre.err_str); return 1; }