mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
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:
parent
e18f533945
commit
27a35821a1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user