Code

sysdbd: Don't leak memory when aborting from the main loop.
[sysdb.git] / 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 */