diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-03-22 20:28:17 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-03-22 20:32:29 +0100 |
commit | 31b459cb1d0ba3280cbc3fc06ce6fab903c07da6 (patch) | |
tree | a065c15c16611897e0d9cc00ea9035896dc97e20 | |
parent | f9dad9ffdd41c00d1fc7420f2f55983c7f6df8bc (diff) |
main: strdup command line arguments that are modified
This ensures that the process will show the correct command line in ps
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -249,6 +249,7 @@ int main(int argc, char **argv) break; #endif case 'p': + optarg = strdup(optarg); bound += add_listener_arg(optarg, (ch == 's')); break; @@ -305,6 +306,7 @@ int main(int argc, char **argv) break; case 'i': + optarg = strdup(optarg); port = strchr(optarg, '='); if (optarg[0] != '.' || !port) { fprintf(stderr, "Error: Invalid interpreter: %s\n", @@ -337,6 +339,7 @@ int main(int argc, char **argv) break; case 'd': + optarg = strdup(optarg); port = alloca(strlen(optarg) + 1); if (!port) return -1; |