From d2b4d8ef41431c89d301150b07d554eec1871120 Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Sat, 17 Dec 2011 13:06:37 -0500 Subject: [PATCH] FS-3768 Mutex lock missing. I would personally removed that lock since all the sql call does lock it now. But maybe it required that no other request be done in the mean time. --- src/mod/endpoints/mod_sofia/sofia_reg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index deaa379a59..ea7ca0a6cf 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -1520,6 +1520,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand char buf[32] = ""; sql = switch_mprintf("select count(*) from sip_registrations where sip_user='%q' and sip_host='%q' and contact='%q'", to_user, reg_host, contact_str); + switch_mutex_lock(profile->ireg_mutex); + sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, buf, sizeof(buf)); switch_safe_free(sql); if (atoi(buf) > 0) {