]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lib/slre: Fix memory leak if regex compilation fails
authorFrancois Berder <fberder@outlook.fr>
Sun, 12 Nov 2023 19:16:50 +0000 (20:16 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 29 Nov 2023 14:32:15 +0000 (09:32 -0500)
Signed-off-by: Francois Berder <fberder@outlook.fr>
lib/slre.c

index e82a9e7635b1a1eafcd52130ddad33f156dad060..e1a50443e04641d8f0b8a9c078455f87d2013b8c 100644 (file)
@@ -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;
        }