From b0f5b8d2fab347a062fa6ed34ff2908a1c29a41d Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Sat, 28 May 2011 07:51:35 +0530 Subject: echo-cancel: Fix a crash is speex cleanup If module initialisation fails, the speex done() function might try to free a value that's not been allocated yet. Adding protection for this condition. --- src/modules/echo-cancel/speex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/echo-cancel/speex.c b/src/modules/echo-cancel/speex.c index ce361fc3..72c52680 100644 --- a/src/modules/echo-cancel/speex.c +++ b/src/modules/echo-cancel/speex.c @@ -109,6 +109,7 @@ void pa_speex_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *p } void pa_speex_ec_done(pa_echo_canceller *ec) { - speex_echo_state_destroy(ec->params.priv.speex.state); + if (ec->params.priv.speex.state) + speex_echo_state_destroy(ec->params.priv.speex.state); ec->params.priv.speex.state = NULL; } -- cgit