aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2012-10-12 13:35:40 -0400
committerBruce Momjian <bruce@momjian.us>2012-10-12 13:35:43 -0400
commit49ec613201b2e9debdf9e9ad9a2ad7c6c8083729 (patch)
tree16626d363ecc7b021b2fda82bb27b811e2335c09 /src/interfaces
parenta29f7ed5544ef583747c0dcc3fc2afac1fb191ef (diff)
downloadpostgresql-49ec613201b2e9debdf9e9ad9a2ad7c6c8083729.tar.gz
postgresql-49ec613201b2e9debdf9e9ad9a2ad7c6c8083729.zip
In our source code, make a copy of getopt's 'optarg' string arguments,
rather than just storing a pointer.
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index 7e7bae30a0b..1b775a13e8f 100644
--- a/src/interfaces/ecpg/preproc/ecpg.c
+++ b/src/interfaces/ecpg/preproc/ecpg.c
@@ -171,7 +171,7 @@ main(int argc, char *const argv[])
regression_mode = true;
break;
case 'o':
- output_filename = optarg;
+ output_filename = strdup(optarg);
if (strcmp(output_filename, "-") == 0)
yyout = stdout;
else