From c441fc5b093064a83108bc5c9d8e4243937a8c32 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 28 Aug 2007 17:08:32 +0000 Subject: [PATCH] fix stupidity git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5671 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_reg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 663856de75..04bf711d40 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -729,7 +729,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co const char *passwd = NULL; const char *a1_hash = NULL; char *sql; - switch_xml_t domain, xml, user, param, xparams; + switch_xml_t domain, xml = NULL, user, param, xparams; char hexdigest[2 * SU_MD5_DIGEST_SIZE + 1] = ""; username = realm = nonce = uri = qop = cnonce = nc = response = NULL; @@ -806,7 +806,6 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co if (!(xparams = switch_xml_child(user, "params"))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "can't find params for user [%s@%s]\n", username, realm); - switch_xml_free(xml); ret = AUTH_FORBIDDEN; goto end; } @@ -892,7 +891,9 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co } end: - switch_xml_free(xml); + if (xml) { + switch_xml_free(xml); + } switch_safe_free(input); switch_safe_free(input2); switch_safe_free(username);