aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-12 02:05:51 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-12 02:07:15 +0200
commit9b723049635329feda63fab675df794e429aa151 (patch)
treef1d3214ce050f09ea6e4cbe423f9f781bd3def88
parent1cd9ba8d973d46d19686aa43f6e3f5f76c69a28f (diff)
downloadliberty-9b723049635329feda63fab675df794e429aa151.tar.gz
liberty-9b723049635329feda63fab675df794e429aa151.tar.xz
liberty-9b723049635329feda63fab675df794e429aa151.zip
Fix a memory leak in mpd_client_parse_line()
-rw-r--r--liberty-proto.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/liberty-proto.c b/liberty-proto.c
index a605f37..f7a62fd 100644
--- a/liberty-proto.c
+++ b/liberty-proto.c
@@ -1567,13 +1567,12 @@ mpd_client_parse_line (struct mpd_client *self, const char *line)
if (!strcmp (line, "list_OK"))
strv_append_owned (&self->data, NULL);
else if (mpd_client_parse_response (line, &response))
- {
mpd_client_dispatch (self, &response);
- free (response.current_command);
- free (response.message_text);
- }
else
strv_append (&self->data, line);
+
+ free (response.current_command);
+ free (response.message_text);
return true;
}