wwwroot = strdup(argv[1]) so we don't end up stripping the only existing

slash out of the commandline shown by ps(1).  And free it on shutdown.
This commit is contained in:
Emil Mikulic 2003-12-13 14:11:49 +00:00
parent e18f533945
commit 27a35821a1
1 changed files with 2 additions and 1 deletions

View File

@ -997,7 +997,7 @@ static void parse_commandline(const int argc, char *argv[])
exit(EXIT_FAILURE);
}
wwwroot = argv[1];
wwwroot = xstrdup(argv[1]);
/* Strip ending slash. */
if (wwwroot[strlen(wwwroot)-1] == '/') wwwroot[strlen(wwwroot)-1] = '\0';
@ -2282,6 +2282,7 @@ static void exit_quickly(int sig)
}
free(mime_map);
free(keep_alive_field);
free(wwwroot);
printf("done!\n");
getrusage(RUSAGE_SELF, &r);