aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-01-18 16:34:25 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2017-01-18 16:34:25 +0100
commit74b00a921a214a7ea097fd97a239fde7f25aae48 (patch)
tree274f7f1d9ed238129667cb2432cac9c0c4135729
parentf53b717f3bba27ca1c42486d3742c91967f3fe93 (diff)
downloadliberty-74b00a921a214a7ea097fd97a239fde7f25aae48.tar.gz
liberty-74b00a921a214a7ea097fd97a239fde7f25aae48.tar.xz
liberty-74b00a921a214a7ea097fd97a239fde7f25aae48.zip
MPD client: fix resource leak
-rw-r--r--liberty-proto.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/liberty-proto.c b/liberty-proto.c
index e99b659..cf84586 100644
--- a/liberty-proto.c
+++ b/liberty-proto.c
@@ -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;