From 2401fec54b48d8dfb1ec5a2f33a092dac076c0f3 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 8 Feb 2011 13:01:42 -0600 Subject: [PATCH] minor regression from 4ae8282e6c6df0e296113e9b4b4a1383e1af8ad7 (sofia_contact with no args from cli caused seg) --- src/mod/endpoints/mod_sofia/mod_sofia.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index c6832030b4..2a2ec63221 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -3458,7 +3458,7 @@ SWITCH_STANDARD_API(sofia_contact_function) { char *data; char *user = NULL; - char *domain = NULL; + char *domain = NULL, *dup_domain = NULL; char *concat = NULL; char *profile_name = NULL; char *p; @@ -3501,7 +3501,8 @@ SWITCH_STANDARD_API(sofia_contact_function) } if (zstr(domain)) { - domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session)); + dup_domain = switch_core_get_variable_dup("domain"); + domain = dup_domain; } if (!user) goto end; @@ -3567,6 +3568,7 @@ SWITCH_STANDARD_API(sofia_contact_function) switch_safe_free(mystream.data); switch_safe_free(data); + switch_safe_free(dup_domain); return SWITCH_STATUS_SUCCESS; }