diff --git a/src/switch_channel.c b/src/switch_channel.c index c5c61d43ae..09a0697f9f 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -4175,6 +4175,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c if (!switch_core_test_flag(SCF_API_EXPANSION) || (api_list && !switch_event_check_permission_list(api_list, vname))) { func_val = NULL; sub_val = ""; + free(stream.data); } else { if (switch_api_execute(vname, vval, channel->session, &stream) == SWITCH_STATUS_SUCCESS) { func_val = stream.data;