Fix a couple file descriptor leaks.

This commit is contained in:
Justin Maggard
2014-01-16 13:11:54 -08:00
parent 2aedabb52c
commit a21bbe557d
2 changed files with 5 additions and 4 deletions

View File

@ -771,6 +771,7 @@ SubmitServicesToMiniSSDPD(const char *host, unsigned short port)
{
DPRINTF(E_ERROR, L_SSDP, "connect(\"%s\"): %s",
minissdpdsocketpath, strerror(errno));
close(s);
return -1;
}
for (i = 0; known_service_types[i]; i++)
@ -802,6 +803,7 @@ SubmitServicesToMiniSSDPD(const char *host, unsigned short port)
if(write(s, buffer, p - buffer) < 0)
{
DPRINTF(E_ERROR, L_SSDP, "write(): %s", strerror(errno));
close(s);
return -1;
}
}