lib/slre: Fix memory leak if regex compilation fails

Signed-off-by: Francois Berder <fberder@outlook.fr>
This commit is contained in:
Francois Berder 2023-11-12 20:16:50 +01:00 committed by Tom Rini
parent 9f0588a1a9
commit 891b178c57

View file

@ -686,6 +686,7 @@ int main(int argc, char *argv[])
} }
if (!slre_compile(&slre, argv[1])) { if (!slre_compile(&slre, argv[1])) {
(void) fclose(fp);
fprintf(stderr, "Error compiling slre: %s\n", slre.err_str); fprintf(stderr, "Error compiling slre: %s\n", slre.err_str);
return 1; return 1;
} }