Make some essentially cosmetic changes to return memory when the program exits. The program never exits, but it's good for valgrind.

This commit is contained in:
Mike Brady
2018-05-11 10:56:16 +01:00
parent c43e1d7be7
commit d805ce914e
3 changed files with 44 additions and 20 deletions
+10 -2
View File
@@ -364,9 +364,17 @@ static int avahi_register(char *srvname, int srvport) {
static void avahi_unregister(void) {
debug(1, "avahi: avahi_unregister.");
if (tpoll)
if (tpoll) {
avahi_threaded_poll_stop(tpoll);
tpoll = NULL;
if (client) {
avahi_client_free(client);
client = NULL;
};
avahi_threaded_poll_free(tpoll);
tpoll = NULL;
}
if (service_name)
free(service_name);