From 7aa7a7b6ac39371bbc7cd46ddf5d50ffd6e2a965 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Jan 2009 03:24:40 +0100 Subject: fix destruction when no profiles are defined --- src/pulsecore/card.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c index ec4a50c5..8e29f0a5 100644 --- a/src/pulsecore/card.c +++ b/src/pulsecore/card.c @@ -165,10 +165,12 @@ void pa_card_free(pa_card *c) { pa_assert(pa_idxset_isempty(c->sources)); pa_idxset_free(c->sources, NULL, NULL); - while ((profile = pa_hashmap_steal_first(c->profiles))) - pa_card_profile_free(profile); + if (c->profiles) { + while ((profile = pa_hashmap_steal_first(c->profiles))) + pa_card_profile_free(profile); - pa_hashmap_free(c->profiles, NULL, NULL); + pa_hashmap_free(c->profiles, NULL, NULL); + } pa_proplist_free(c->proplist); pa_xfree(c->driver); -- cgit