diff options
author | Michael Meskes <meskes@postgresql.org> | 2018-03-14 00:47:49 +0100 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2018-03-14 00:51:17 +0100 |
commit | db2fc801f66a70969cbdd5673ed9d02025c70695 (patch) | |
tree | 3b1a793fa87a7e03b21546c6d7a4231d9de280e2 /src/interfaces/ecpg/preproc/ecpg.c | |
parent | 1e22166e5ebbc3df7684209657ea58ba880546d6 (diff) | |
download | postgresql-db2fc801f66a70969cbdd5673ed9d02025c70695.tar.gz postgresql-db2fc801f66a70969cbdd5673ed9d02025c70695.zip |
Fix double frees in ecpg.
Patch by Patrick Krecker <patrick@judicata.com>
Diffstat (limited to 'src/interfaces/ecpg/preproc/ecpg.c')
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index cd770c8b156..0704837396f 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); } |