From 4f2824e37167ab2717c819fedaa21a049dc898f0 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sat, 18 Nov 2006 16:35:03 +0000 Subject: [PATCH] need to free the head pointer of malloc'd memory (form anthm's working copy) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3402 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 1cfd6b2d5d..2fd5f1043a 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -4116,7 +4116,7 @@ static void sip_r_register(int status, sip_www_authenticate_t const *authenticate = NULL; switch_core_session_t *session = sofia_private ? sofia_private->session : NULL; char const *realm = NULL; - char *p = NULL, *qrealm = NULL; + char *p = NULL, *duprealm = NULL, *qrealm = NULL; char const *scheme = NULL; int index; char *cur; @@ -4157,8 +4157,9 @@ static void sip_r_register(int status, return; } - qrealm = strdup(realm); - + duprealm = strdup(realm); + qrealm = duprealm; + while(*qrealm && *qrealm == '"') { *qrealm++; } @@ -4184,7 +4185,7 @@ static void sip_r_register(int status, } } - switch_safe_free(qrealm); + switch_safe_free(duprealm); if (!oreg) { return;