From db2fc801f66a70969cbdd5673ed9d02025c70695 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Wed, 14 Mar 2018 00:47:49 +0100 Subject: [PATCH] Fix double frees in ecpg. Patch by Patrick Krecker --- src/interfaces/ecpg/preproc/ecpg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index cd770c8b15..0704837396 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -327,6 +327,7 @@ main(int argc, char *const argv[]) fprintf(stderr, _("%s: could not open file \"%s\": %s\n"), progname, output_filename, strerror(errno)); free(output_filename); + output_filename = NULL; free(input_filename); continue; } @@ -474,8 +475,10 @@ main(int argc, char *const argv[]) } } - if (output_filename && out_option == 0) + if (output_filename && out_option == 0) { free(output_filename); + output_filename = NULL; + } free(input_filename); } -- 2.40.0