MPD client: fix resource leak

This commit is contained in:
Přemysl Eric Janouch 2017-01-18 16:34:25 +01:00
parent f53b717f3b
commit 74b00a921a
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 5 additions and 1 deletions

View File

@ -1925,7 +1925,11 @@ mpd_client_connect_unix (struct mpd_client *self, const char *address,
free (expanded);
if (connect (fd, (struct sockaddr *) &sun, sizeof sun))
return error_set (e, "%s: %s", "connect", strerror (errno));
{
error_set (e, "%s: %s", "connect", strerror (errno));
xclose (fd);
return false;
}
mpd_client_finish_connection (self, fd);
return true;