FS-3137 --resolve less of a memory leak more of a pool swelling, replaced a pool strdup that could recur with a strdup/free to avoid it

This commit is contained in:
Anthony Minessale 2011-04-08 14:04:01 -05:00
parent a909940385
commit bcd6c3a188
1 changed files with 14 additions and 13 deletions

View File

@ -1996,7 +1996,9 @@ static void conference_loop_fn_exec_app(conference_member_t *member, caller_cont
switch_event_fire(&event);
}
if ((mydata = switch_core_session_strdup(member->session, action->expanded_data))) {
mydata = strdup(action->expanded_data);
switch_assert(mydata);
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
if (argc > 0) {
app = argv[0];
@ -2010,10 +2012,6 @@ static void conference_loop_fn_exec_app(conference_member_t *member, caller_cont
(char *) action->expanded_data);
goto done;
}
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_ERROR, "Unable to allocate memory to duplicate execute_app data.\n");
goto done;
}
if (!app) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_ERROR, "Unable to find application.\n");
@ -2029,8 +2027,11 @@ static void conference_loop_fn_exec_app(conference_member_t *member, caller_cont
switch_core_session_execute_application(member->session, app, arg);
switch_core_session_set_read_codec(member->session, &member->read_codec);
switch_channel_clear_app_flag(channel, CF_APP_TAGGED);
done:
switch_safe_free(mydata);
return;
}