From 74b00a921a214a7ea097fd97a239fde7f25aae48 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Wed, 18 Jan 2017 16:34:25 +0100
Subject: MPD client: fix resource leak
---
liberty-proto.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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;
--
cgit v1.2.3-70-g09d2