summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2013-07-11 13:35:24 +0300
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2013-07-11 13:35:24 +0300
commitada83601f04f73177ea5f8bda01f02a38ba55409 (patch)
tree3dc1b165fb39b4b6c924030303927c2b3cae8aca
parent1ce71cbd8206d1be59ac62274ad83cdbe693a96a (diff)
module: Fix crash in pa_module_unload_all()
Previously, if there were no modules loaded when the daemon exited, pa_module_unload_all() would crash due to giving zero count to pa_xnew(). Thanks to Pierre Ossman for the patch.
-rw-r--r--src/pulsecore/module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c
index 396096942..16582b329 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.c
@@ -221,6 +221,9 @@ void pa_module_unload_all(pa_core *c) {
pa_assert(c);
pa_assert(c->modules);
+ if (pa_idxset_isempty(c->modules))
+ return;
+
/* Unload modules in reverse order by default */
indices = pa_xnew(uint32_t, pa_idxset_size(c->modules));
i = 0;