diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-01-18 16:34:25 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-01-18 16:34:25 +0100 |
commit | 74b00a921a214a7ea097fd97a239fde7f25aae48 (patch) | |
tree | 274f7f1d9ed238129667cb2432cac9c0c4135729 | |
parent | f53b717f3bba27ca1c42486d3742c91967f3fe93 (diff) | |
download | liberty-74b00a921a214a7ea097fd97a239fde7f25aae48.tar.gz liberty-74b00a921a214a7ea097fd97a239fde7f25aae48.tar.xz liberty-74b00a921a214a7ea097fd97a239fde7f25aae48.zip |
MPD client: fix resource leak
-rw-r--r-- | liberty-proto.c | 6 |
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; |