From: Marc Olivier Chouinard Date: Sat, 17 Dec 2011 18:06:37 +0000 (-0500) Subject: FS-3768 Mutex lock missing. I would personally removed that lock since all the sql... X-Git-Tag: v1.2-rc1~27^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2b4d8ef41431c89d301150b07d554eec1871120;p=thirdparty%2Ffreeswitch.git 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. --- 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) {