postgres.git / summary / log / commit / refs

commit    fcc15bf38100edf26b38c73a809579fc0e9ccc78
Author:   Michael Meskes <meskes@postgresql.org>
Date:     Tue Mar 13 23:47:49 2018 +0000
First released in: 11.0, 9.3.23, 9.4.18, 9.5.13, 9.6.9, 10.4

    Fix double frees in ecpg.
    
    Patch by Patrick Krecker <patrick@judicata.com>


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 96a502a6447..9741cd03e88 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); } [parent: 25a2ba35edbc]