From a4d3546635a0904f9ab748d32496f5ff5000a085 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Fri, 5 Dec 2014 18:36:03 +0100 Subject: [PATCH] minissdpd/minissdpd.c: free service list --- minissdpd/minissdpd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/minissdpd/minissdpd.c b/minissdpd/minissdpd.c index 7bfde40..e081e04 100644 --- a/minissdpd/minissdpd.c +++ b/minissdpd/minissdpd.c @@ -1350,6 +1350,16 @@ quit: free(devlist); devlist = next; } + /* empty service list */ + while(servicelisthead.lh_first != NULL) { + struct service * serv = servicelisthead.lh_first; + LIST_REMOVE(servicelisthead.lh_first, entries); + free(serv->st); + free(serv->usn); + free(serv->server); + free(serv->location); + free(serv); + } if(unlink(pidfilename) < 0) syslog(LOG_ERR, "unlink(%s): %m", pidfilename); closelog();