raop: Fix a memory leak

a.path_or_host wasn't freed after calling pa_parse_address().
This commit is contained in:
Tanu Kaskinen 2014-11-19 18:43:07 +02:00
parent 275ffb3657
commit 97807448dc

View file

@ -372,14 +372,19 @@ pa_raop_client* pa_raop_client_new(pa_core *core, const char* host) {
pa_assert(core); pa_assert(core);
pa_assert(host); pa_assert(host);
if (pa_parse_address(host, &a) < 0 || a.type == PA_PARSED_ADDRESS_UNIX) if (pa_parse_address(host, &a) < 0)
return NULL; return NULL;
if (a.type == PA_PARSED_ADDRESS_UNIX) {
pa_xfree(a.path_or_host);
return NULL;
}
c = pa_xnew0(pa_raop_client, 1); c = pa_xnew0(pa_raop_client, 1);
c->core = core; c->core = core;
c->fd = -1; c->fd = -1;
c->host = pa_xstrdup(a.path_or_host); c->host = a.path_or_host;
if (a.port) if (a.port)
c->port = a.port; c->port = a.port;
else else