[pulseaudio-discuss] [PATCH] bluetooth: Don't free read_smoother in pa__done().

Tanu Kaskinen tanu.kaskinen at digia.com
Thu Mar 22 03:23:13 PDT 2012

pa__done() calls stop_thread(), and stop_thread() already
frees the smoother. The duplicate freeing is not strictly
a bug, but static analyzers (in this case Coverity) may
complain about double-freeing, because when pa__done()
"frees" the smoother (which doesn't actually ever happen),
the pointer is not nulled. pa__done() then calls
bt_transport_release(), which will also free the smoother
if it's not NULL.

The analyzer complaint could be silenced also by nulling
the pointer in pa__done(), but since this is clearly
redundant code, I chose to remove it.
 src/modules/bluetooth/module-bluetooth-device.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 7992e12..d5240f5 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -3077,9 +3077,6 @@ void pa__done(pa_module *m) {
     if (u->card)
-    if (u->read_smoother)
-        pa_smoother_free(u->read_smoother);
     if (u->a2dp.buffer)

More information about the pulseaudio-discuss mailing list