switch_size_t len;
switch_assert(memory_manager.memory_pool != NULL);
- if (!todup)
+ if (!todup) {
return NULL;
+ }
+
+ if (switch_strlen_zero(todup)) {
+ return SWITCH_BLANK_STRING;
+ }
#ifdef LOCK_MORE
#ifdef USE_MEM_LOCK
if (!todup) {
return NULL;
}
+
+ if (switch_strlen_zero(todup)) {
+ return SWITCH_BLANK_STRING;
+ }
+
#ifdef LOCK_MORE
#ifdef USE_MEM_LOCK
switch_mutex_lock(memory_manager.mem_lock);
if (!todup) {
return NULL;
}
+
+ if (switch_strlen_zero(todup)) {
+ return SWITCH_BLANK_STRING;
+ }
+
#ifdef LOCK_MORE
#ifdef USE_MEM_LOCK
switch_mutex_lock(memory_manager.mem_lock);
session->stack_count++;
new_profile = switch_caller_profile_clone(session, profile);
- new_profile->destination_number = switch_core_session_strdup(session, exten);
+ new_profile->destination_number = switch_core_strdup(new_profile->pool, exten);
if (!switch_strlen_zero(dialplan)) {
- new_profile->dialplan = switch_core_session_strdup(session, dialplan);
+ new_profile->dialplan = switch_core_strdup(new_profile->pool, dialplan);
}
if (!switch_strlen_zero(context)) {
- new_profile->context = switch_core_session_strdup(session, context);
+ new_profile->context = switch_core_strdup(new_profile->pool, context);
}
- if (!(dpstr = switch_core_session_strdup(session, new_profile->dialplan))) {
- abort();
- }
+ dpstr = switch_core_session_strdup(session, new_profile->dialplan);
argc = switch_separate_string(dpstr, ',', dp, (sizeof(dp) / sizeof(dp[0])));
for (x = 0; x < argc; x++) {