mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-09 13:29:59 -05:00
raop: Fix a memory leak
a.path_or_host wasn't freed after calling pa_parse_address().
This commit is contained in:
parent
275ffb3657
commit
97807448dc
1 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue