[pulseaudio-discuss] [PATCH 2/2] echo-cancel: fix a memory leak
Tanu Kaskinen
tanuk at iki.fi
Thu Nov 9 12:12:34 UTC 2017
The pa_echo_canceller_msg object was never unreffed.
---
src/modules/echo-cancel/module-echo-cancel.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index ee3725abd..4fc837d2a 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -2164,8 +2164,10 @@ void pa__done(pa_module*m) {
if (u->ec->done)
u->ec->done(u->ec);
- if (u->ec->msg)
+ if (u->ec->msg) {
u->ec->msg->dead = true;
+ pa_echo_canceller_msg_unref(u->ec->msg);
+ }
pa_xfree(u->ec);
}
@@ -2346,6 +2348,7 @@ int main(int argc, char* argv[]) {
u.ec->done(u.ec);
u.ec->msg->dead = true;
+ pa_echo_canceller_msg_unref(u.ec->msg);
out:
if (u.captured_file)
--
2.14.2
More information about the pulseaudio-discuss
mailing list