zeroconf-discover: fix a memory leak
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Tue, 20 Sep 2016 17:26:00 +0000 (10:26 -0700)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 21 Sep 2016 09:25:15 +0000 (12:25 +0300)
Coverity CID: #1358700

https://bugs.freedesktop.org/show_bug.cgi?id=97876

src/modules/module-zeroconf-discover.c

index bd7e6ab..96476b7 100644 (file)
@@ -173,9 +173,10 @@ static void resolver_cb(
                 ss.channels = (uint8_t) atoi(value);
             else if (pa_streq(key, "format"))
                 ss.format = pa_parse_sample_format(value);
-            else if (pa_streq(key, "icon-name"))
+            else if (pa_streq(key, "icon-name")) {
+                pa_xfree(properties);
                 properties = pa_sprintf_malloc("device.icon_name=%s", value);
-            else if (pa_streq(key, "channel_map")) {
+            else if (pa_streq(key, "channel_map")) {
                 pa_channel_map_parse(&cm, value);
                 channel_map_set = true;
             }