commit 2bd3f682a00bcdbcd3cddafb512e128cc757e47a from: Stefan Sperling date: Sat Dec 28 07:49:49 2024 UTC free libevent event-base memory when gotwebd exits to avoid leak report commit - f42651a8406450107db701f40e24cd4ea29db65f commit + 2bd3f682a00bcdbcd3cddafb512e128cc757e47a blob - 1bf4f70aa785fff83393081955893b0418f49d76 blob + aa4091b4467fdc10e4afd07ab963ee00e007b1b7 --- gotwebd/gotwebd.c +++ gotwebd/gotwebd.c @@ -270,6 +270,7 @@ int main(int argc, char **argv) { struct event sigint, sigterm, sighup, sigpipe, sigusr1; + struct event_base *evb; struct gotwebd *env; struct passwd *pw; int ch, i; @@ -367,7 +368,7 @@ main(int argc, char **argv) if (!env->gotwebd_debug && daemon(1, 0) == -1) fatal("daemon"); - event_init(); + evb = event_init(); env->nserver = env->prefork_gotwebd; env->iev_server = calloc(env->nserver, sizeof(*env->iev_server)); @@ -421,6 +422,7 @@ main(int argc, char **argv) #endif event_dispatch(); + event_base_free(evb); log_debug("%s gotwebd exiting", getprogname()); blob - bf8ee9b96327aec085233a34b50c1126eedb52d0 blob + a395d6adaa88c79a67693a290699a888af6b1b95 --- gotwebd/sockets.c +++ gotwebd/sockets.c @@ -87,8 +87,9 @@ void sockets(struct gotwebd *env, int fd) { struct event sighup, sigint, sigusr1, sigchld, sigterm; + struct event_base *evb; - event_init(); + evb = event_init(); sockets_rlimit(-1); @@ -123,6 +124,7 @@ sockets(struct gotwebd *env, int fd) #endif event_dispatch(); + event_base_free(evb); sockets_shutdown(); }