diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index d2c86eeca1..3085b96b49 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -1023,6 +1023,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, } } } else if (res == 0 && ast_test_flag(flags, OPTION_EXITONHANGUP)) { + ast_autochan_destroy(autochan); iter = ast_channel_iterator_destroy(iter); goto exit; }