diff options
author | David Henningsson <david.henningsson@canonical.com> | 2011-09-22 13:57:56 +0200 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-09-22 23:15:18 +0530 |
commit | 165bd13d9e596b98ebc9cd8f9927d606934ff709 (patch) | |
tree | a0712d79d50e57b15ac0d0262f53a098686d09df | |
parent | cae3235369f923dcf1e1ee402a4b3d6aafe9c27b (diff) |
dbus: Don't crash if the module does not load
If module-dbus-protocol fails to start, pa__done is still called,
which falsified the assumption that u->connections was always set.
BugLink: http://bugs.launchpad.net/bugs/855729
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
-rw-r--r-- | src/modules/dbus/module-dbus-protocol.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/dbus/module-dbus-protocol.c b/src/modules/dbus/module-dbus-protocol.c index ae9df204..c24e1e0e 100644 --- a/src/modules/dbus/module-dbus-protocol.c +++ b/src/modules/dbus/module-dbus-protocol.c @@ -594,10 +594,12 @@ void pa__done(pa_module *m) { if (u->core_iface) pa_dbusiface_core_free(u->core_iface); - while ((c = pa_idxset_steal_first(u->connections, NULL))) - connection_free(c); + if (u->connections) { + while ((c = pa_idxset_steal_first(u->connections, NULL))) + connection_free(c); - pa_idxset_free(u->connections, NULL, NULL); + pa_idxset_free(u->connections, NULL, NULL); + } /* This must not be called before the connections are freed, because if * there are any connections left, they will emit the |