mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
role-cork: Fix another minor leak
Credit to David for finding this one.
This commit is contained in:
parent
ded196f93a
commit
750a5c187a
1 changed files with 8 additions and 2 deletions
|
|
@ -225,9 +225,12 @@ int pa__init(pa_module *m) {
|
|||
if (roles) {
|
||||
const char *split_state = NULL;
|
||||
char *n = NULL;
|
||||
while ((n = pa_split(roles, ",", &split_state)))
|
||||
while ((n = pa_split(roles, ",", &split_state))) {
|
||||
if (n[0] != '\0')
|
||||
pa_idxset_put(u->trigger_roles, n, NULL);
|
||||
else
|
||||
pa_xfree(n);
|
||||
}
|
||||
}
|
||||
if (pa_idxset_isempty(u->trigger_roles)) {
|
||||
pa_log_debug("Using role 'phone' as trigger role.");
|
||||
|
|
@ -239,9 +242,12 @@ int pa__init(pa_module *m) {
|
|||
if (roles) {
|
||||
const char *split_state = NULL;
|
||||
char *n = NULL;
|
||||
while ((n = pa_split(roles, ",", &split_state)))
|
||||
while ((n = pa_split(roles, ",", &split_state))) {
|
||||
if (n[0] != '\0')
|
||||
pa_idxset_put(u->cork_roles, n, NULL);
|
||||
else
|
||||
pa_xfree(n);
|
||||
}
|
||||
}
|
||||
if (pa_idxset_isempty(u->cork_roles)) {
|
||||
pa_log_debug("Using roles 'music' and 'video' as cork roles.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue