summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-01-29 20:54:39 +0200
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-01-29 20:56:42 +0200
commitc95b4c22caeb69552406395ee6472ed308301ff2 (patch)
treee92984bd52efe318e952a0feb8193f3187559081
parent537f430c993ee5d83a8c58e8121b457c904d6cdb (diff)
card-restore: Fix a memory leakv4.99.3
entry_read() may set entry->profile, so we need to free that string before we can replace it with a new string.
-rw-r--r--src/modules/module-card-restore.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 252dcce07..5b026020e 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -390,6 +390,7 @@ static pa_hook_result_t card_profile_changed_callback(pa_core *c, pa_card *card,
return PA_HOOK_OK;
if ((entry = entry_read(u, card->name))) {
+ pa_xfree(entry->profile);
entry->profile = pa_xstrdup(card->active_profile->name);
pa_log_info("Storing card profile for card %s.", card->name);
} else {