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.");
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.");