[pulseaudio-commits] src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Thu Nov 20 11:38:55 PST 2014


 src/modules/raop/raop_client.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 97807448dc0b3e243986773c1168747ca4b612a5
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date:   Wed Nov 19 18:43:07 2014 +0200

    raop: Fix a memory leak
    
    a.path_or_host wasn't freed after calling pa_parse_address().

diff --git a/src/modules/raop/raop_client.c b/src/modules/raop/raop_client.c
index 5bb0bb4..7a6d009 100644
--- a/src/modules/raop/raop_client.c
+++ b/src/modules/raop/raop_client.c
@@ -372,14 +372,19 @@ pa_raop_client* pa_raop_client_new(pa_core *core, const char* host) {
     pa_assert(core);
     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;
 
+    if (a.type == PA_PARSED_ADDRESS_UNIX) {
+        pa_xfree(a.path_or_host);
+        return NULL;
+    }
+
     c = pa_xnew0(pa_raop_client, 1);
     c->core = core;
     c->fd = -1;
 
-    c->host = pa_xstrdup(a.path_or_host);
+    c->host = a.path_or_host;
     if (a.port)
         c->port = a.port;
     else



More information about the pulseaudio-commits mailing list