X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=server.c;h=076bf4fabbf2b0900e759d5cf4fb1427fa18bc99;hb=958b4b6c54d1539a9e6683d3148a742c41760433;hp=e5335346010313277e258b3d2bb0a0c9f108fbfc;hpb=27e4eafccad381c523d9e62044f9f76c37302874;p=paraslash.git diff --git a/server.c b/server.c index e5335346..076bf4fa 100644 --- a/server.c +++ b/server.c @@ -643,6 +643,21 @@ static int server_select(int max_fileno, fd_set *readfds, fd_set *writefds, return ret; } +/** + * Deallocate all lopsub parse results. + * + * The server allocates a parse result for command line options and optionally + * a second parse result for the effective configuration, defined by merging + * the command line options with the options stored in the configuration file. + * This function frees both structures. + */ +void free_lpr(void) +{ + lls_free_parse_result(server_lpr, CMD_PTR); + if (server_lpr != cmdline_lpr) + lls_free_parse_result(cmdline_lpr, CMD_PTR); +} + /** * The main function of para_server. * @@ -686,8 +701,6 @@ int main(int argc, char *argv[]) vss_shutdown(); shm_detach(mmd); user_list_deplete(); - lls_free_parse_result(server_lpr, CMD_PTR); - if (server_lpr != cmdline_lpr) - lls_free_parse_result(cmdline_lpr, CMD_PTR); + free_lpr(); exit(ret < 0? EXIT_FAILURE : EXIT_SUCCESS); }