modules: Fix entry leak in module-card-restore

CID 1323585

entry_read() allocates an entry which must be freed
This commit is contained in:
Peter Meerwald 2015-09-14 17:23:29 +02:00 committed by Peter Meerwald
parent d36baaf81e
commit 3193f6a2c4

View file

@ -438,12 +438,15 @@ static pa_hook_result_t profile_available_changed_callback(void *hook_data, void
if (!entry) if (!entry)
return PA_HOOK_OK; return PA_HOOK_OK;
if (!pa_streq(profile->name, entry->profile)) if (!pa_streq(profile->name, entry->profile)) {
entry_free(entry);
return PA_HOOK_OK; return PA_HOOK_OK;
}
pa_log_info("Card %s profile %s became available, activating.", card->name, profile->name); pa_log_info("Card %s profile %s became available, activating.", card->name, profile->name);
pa_card_set_profile(profile->card, profile, true); pa_card_set_profile(profile->card, profile, true);
entry_free(entry);
return PA_HOOK_OK; return PA_HOOK_OK;
} }