diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-09-08 02:00:43 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-09-08 02:01:26 +0200 |
commit | 40051598b96da61da796b7e0811512b18f3262ed (patch) | |
tree | 59cb117ad77fa25334289f3706fae49cd9a9a7f4 | |
parent | 553ebab10f3ae777a55b10e2da0595c82cb06819 (diff) |
WIP
-rw-r--r-- | main.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -134,7 +134,7 @@ static int usage(const char *name) "Usage: %s -p [addr:]port -h docroot\n" " -f Do not fork to background\n" " -c file Configuration file, default is '/etc/httpd.conf'\n" - " -b interface Bind subsequent ports (and addresses) to specified" + " -b interface Bind subsequent ports (and addresses) to specified\n" " network interface with SO_BINDTODEVICE\n" " -p [addr:]port Bind to specified address and port, multiple allowed\n" #ifdef HAVE_TLS @@ -288,8 +288,10 @@ int main(int argc, char **argv) case 'b': if (optarg[0] == '\0') device = NULL; - else - device = optarg; + else { + free(device); + device = strdup(optarg); + } break; case 's': @@ -564,6 +566,9 @@ int main(int argc, char **argv) return 1; #endif + free(device); + device = NULL; + /* fork (if not disabled) */ if (!nofork) { switch (fork()) { |