diff --git a/minidlna.c b/minidlna.c index 4ee55c1..4f60a5d 100644 --- a/minidlna.c +++ b/minidlna.c @@ -1296,6 +1296,7 @@ shutdown: /* kill other child processes */ process_reap_children(); + free(children); /* close out open sockets */ while (upnphttphead.lh_first != NULL) diff --git a/upnphttp.c b/upnphttp.c index e3a21bd..b6dd887 100644 --- a/upnphttp.c +++ b/upnphttp.c @@ -441,14 +441,14 @@ next_header: else if (client) { enum client_types type = client_types[client].type; - enum client_types ctype = client_types[n].type; + enum client_types ctype = h->req_client->type->type; /* If we know the client and our new detection is generic, use our cached info */ /* If we detected a Samsung Series B earlier, don't overwrite it with Series A info */ if ((ctype && ctype < EStandardDLNA150 && type >= EStandardDLNA150) || (ctype == ESamsungSeriesB && type == ESamsungSeriesA)) return; - clients[n].type = &client_types[client]; - clients[n].age = time(NULL); + h->req_client->type = &client_types[client]; + h->req_client->age = time(NULL); } }