summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-20 03:24:40 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-20 03:24:40 +0100
commit7aa7a7b6ac39371bbc7cd46ddf5d50ffd6e2a965 (patch)
treea2cbc687a5116a1cc440d0bfe25069dc006cd248
parent936862362c30c22f42f33bd717b5f915f9c04657 (diff)
fix destruction when no profiles are defined
-rw-r--r--src/pulsecore/card.c8
1 files changed, 5 insertions, 3 deletions
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);