diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-07-03 18:11:54 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-07-03 18:19:20 +0530 |
commit | dd4c6bc45c50b95ba819e7d75294fb9ca1a5bf3a (patch) | |
tree | 6e7f598fbabd62ea2e1b9b04276fecce0f684e4d | |
parent | 700b86814b7533a92d29f02109381c56f3a820aa (diff) | |
download | pulseaudio-panda-dd4c6bc45c50b95ba819e7d75294fb9ca1a5bf3a.tar.gz pulseaudio-panda-dd4c6bc45c50b95ba819e7d75294fb9ca1a5bf3a.tar.bz2 pulseaudio-panda-dd4c6bc45c50b95ba819e7d75294fb9ca1a5bf3a.zip |
role-cork: Fix another minor leak
Credit to David for finding this one.
-rw-r--r-- | src/modules/module-role-cork.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/modules/module-role-cork.c b/src/modules/module-role-cork.c index 8306987e..8f8b58dc 100644 --- a/src/modules/module-role-cork.c +++ b/src/modules/module-role-cork.c @@ -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."); |