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