sink-input,source-output: Fix crasher while setting property
authorArun Raghavan <arun@arunraghavan.net>
Tue, 21 Jun 2016 11:49:39 +0000 (17:19 +0530)
committerArun Raghavan <arun@arunraghavan.net>
Tue, 21 Jun 2016 12:08:21 +0000 (17:38 +0530)
We were missing a case where a property is first set, and then cleared
by setting a NULL value.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
src/pulsecore/sink-input.c
src/pulsecore/source-output.c

index 361b445..c7d99ef 100644 (file)
@@ -1435,7 +1435,7 @@ void pa_sink_input_set_property(pa_sink_input *i, const char *key, const char *v
 
     if (pa_proplist_contains(i->proplist, key)) {
         old_value = pa_xstrdup(pa_proplist_gets(i->proplist, key));
-        if (old_value) {
+        if (value && old_value) {
             if (pa_streq(value, old_value))
                 goto finish;
         } else
index d74a60e..6af1543 100644 (file)
@@ -1087,7 +1087,7 @@ void pa_source_output_set_property(pa_source_output *o, const char *key, const c
 
     if (pa_proplist_contains(o->proplist, key)) {
         old_value = pa_xstrdup(pa_proplist_gets(o->proplist, key));
-        if (old_value) {
+        if (value && old_value) {
             if (pa_streq(value, old_value))
                 goto finish;
         } else