[pulseaudio-commits] Branch 'routing' - src/pulsecore
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Thu Nov 14 05:30:32 PST 2013
src/pulsecore/sink-input.c | 3 ++-
src/pulsecore/source-output.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
New commits:
commit c88a703441a51ad0163aad0ff8fdfc5447944442
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date: Wed Nov 13 17:38:56 2013 +0200
sink-input, source-output: Don't assume that proplist has been initialized in free()
It's bad form to assume in free() that any member of the struct has
been initialized. I ran into problems with this when I reordered
things in pa_sink_input_new() and pa_source_output_new().
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index f9c1766..e4671dc 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -781,7 +781,8 @@ static void sink_input_free(pa_object *o) {
if (PA_SINK_INPUT_IS_LINKED(i->state))
pa_sink_input_unlink(i);
- pa_log_info("Freeing input %u \"%s\"", i->index, pa_strnull(pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME)));
+ pa_log_info("Freeing input %u \"%s\"", i->index,
+ i->proplist ? pa_strnull(pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME)) : "");
/* Side note: this function must be able to destruct properly any
* kind of sink input in any state, even those which are
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 2de6e51..41bdc5a 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -667,7 +667,8 @@ static void source_output_free(pa_object* mo) {
if (PA_SOURCE_OUTPUT_IS_LINKED(o->state))
pa_source_output_unlink(o);
- pa_log_info("Freeing output %u \"%s\"", o->index, pa_strnull(pa_proplist_gets(o->proplist, PA_PROP_MEDIA_NAME)));
+ pa_log_info("Freeing output %u \"%s\"", o->index,
+ o->proplist ? pa_strnull(pa_proplist_gets(o->proplist, PA_PROP_MEDIA_NAME)) : "");
if (o->node)
pa_node_free(o->node);
More information about the pulseaudio-commits
mailing list