summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2018-03-14 00:47:49 +0100
committerMichael Meskes <meskes@postgresql.org>2018-03-14 00:52:11 +0100
commit837d4f739ccf16091d41649a9d22d7e911636a3b (patch)
tree8c341c89b0b90be6b181658813163dce7e370dfb /src
parentc9414e7867f72fd921a154ce93e21b1dbdb65b07 (diff)
Fix double frees in ecpg.
Patch by Patrick Krecker <patrick@judicata.com>
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index cfadb071f02..405de15a634 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);
}