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:50:39 +0100 |
commit | 8559b40c5e3fb068d0dfd81d4a5a9f7411f2cbba (patch) | |
tree | afe2e8962ff944c54ba9876f66e019f7519035cc | |
parent | 1bfb5672306da2d3b3a5e12b3178c165f7aa2392 (diff) | |
download | postgresql-8559b40c5e3fb068d0dfd81d4a5a9f7411f2cbba.tar.gz postgresql-8559b40c5e3fb068d0dfd81d4a5a9f7411f2cbba.zip |
Fix double frees in ecpg.
Patch by Patrick Krecker <patrick@judicata.com>
-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 bad0a667fc2..d938ba67f06 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); } |