mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
card-restore: Fix a memory leak
entry_read() may set entry->profile, so we need to free that string before we can replace it with a new string.
This commit is contained in:
parent
537f430c99
commit
c95b4c22ca
1 changed files with 1 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue