minissdpd/minissdpd.c: free service list

This commit is contained in:
Thomas Bernard 2014-12-05 18:36:03 +01:00
parent afe106d768
commit a4d3546635
1 changed files with 10 additions and 0 deletions

View File

@ -1350,6 +1350,16 @@ quit:
free(devlist); free(devlist);
devlist = next; 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) if(unlink(pidfilename) < 0)
syslog(LOG_ERR, "unlink(%s): %m", pidfilename); syslog(LOG_ERR, "unlink(%s): %m", pidfilename);
closelog(); closelog();