via: 3a10d6a1c51ffc1aba78e7864fc8ba707494bb9d (commit)
from: cbf610c5aa1747e930e8678375285f59c56f08c2 (commit)
= COMMIT LOG ===========================================================
committer: Anthony Minessale
comments:
use strdup instead of core_session_strdup in hangup hook
diff --git a/src/switch_core_state_machine.c b/src/switch_core_state_machine.c
index 276acb8..e2d5070 100644
--- a/src/switch_core_state_machine.c
+++ b/src/switch_core_state_machine.c
@@ -468,7 +468,7 @@ static void api_hook(switch_core_session_t *session, const char *hook_var, int u
{
if (!zstr(hook_var)) {
switch_stream_handle_t stream = { 0 };
- char *cmd = switch_core_session_strdup(session, hook_var);
+ char *cmd = strdup(hook_var);
char *arg = NULL;
char *expanded = NULL;
@@ -485,7 +485,7 @@ static void api_hook(switch_core_session_t *session, const char *hook_var, int u
switch_channel_get_variables(session->channel, &stream.param_event);
switch_channel_event_set_data(session->channel, stream.param_event);
- expanded = switch_channel_expand_variables(session->channel, arg);
+ expanded = switch_event_expand_headers(stream.param_event, arg);
switch_api_execute(cmd, expanded, use_session ? session : NULL, &stream);
@@ -496,6 +496,9 @@ static void api_hook(switch_core_session_t *session, const char *hook_var, int u
if (expanded != arg) {
switch_safe_free(expanded);
}
+
+ switch_safe_free(cmd);
+
switch_safe_free(stream.data);
}
}
Summary of changes: src/switch_core_state_machine.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email
For more info, see http://blog.chomperstomp.com/?p=630
--
FreeSWITCH Source