From fc50a7f6c9e45b0c4e2bb03fbfc42b70e23b9aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sun, 24 Apr 2022 13:24:41 +0200 Subject: 0.0.22 --- src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 0b18c0e..e03b0c2 100644 --- a/src/main.c +++ b/src/main.c @@ -86,7 +86,7 @@ void sc_signalhander (int s) { int main (int argc, char ** argv) { int rs = 0; struct sc_cache * c = sc_cache_init(); - struct MHD_Daemon * d; + struct MHD_Daemon * d = NULL; if (!c) { rs = 1; goto rc; @@ -103,8 +103,9 @@ int main (int argc, char ** argv) { fprintf(stderr, "cleaning up!\n"); fflush(stderr); rc: + if (d) + MHD_stop_daemon(d); /* stop the daemon and then free, threads might still be run */ xmlCleanupParser(); - MHD_stop_daemon(d); /* stop the daemon first and the free, threads might still be running */ sc_cache_free(c); return rs; } -- cgit v1.2.3