Code

sysdbd: Don't leak memory when aborting from the main loop.
authorSebastian Harl <sh@tokkee.org>
Tue, 29 Apr 2014 17:48:19 +0000 (19:48 +0200)
committerSebastian Harl <sh@tokkee.org>
Tue, 29 Apr 2014 17:48:19 +0000 (19:48 +0200)
src/tools/sysdbd/main.c

index 4af2de13715ff1f59189ef0e9e4cab90e408b253..7dc9f26ba4b33bff7ab41a67996bedb34aa1a824 100644 (file)
@@ -292,6 +292,10 @@ main_loop(void)
                }
        }
 
+       /* clean up in case we exited the loop on error */
+       pthread_kill(backend_thread, SIGINT);
+       pthread_join(backend_thread, NULL);
+
        sdb_fe_sock_destroy(sock);
        return status;
 } /* main_loop */