diff --git a/apps/app_sms.c b/apps/app_sms.c index aee2fa6c5a..b5c471b8ee 100644 --- a/apps/app_sms.c +++ b/apps/app_sms.c @@ -2040,6 +2040,12 @@ static int sms_exec(struct ast_channel *chan, const char *data) } res = h.err; /* XXX */ + /* + * The SMS generator data is on the stack. We _MUST_ make sure the generator + * is stopped before returning from this function. + */ + ast_deactivate_generator(chan); + sms_log(&h, '?'); /* log incomplete message */ done: return (res);