Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 103333) +++ channels/chan_sip.c (working copy) @@ -2198,7 +2198,7 @@ if (req.socket.lock) ast_mutex_lock(req.socket.lock); if (!fgets(buf, sizeof(buf), ser->f)) - goto cleanup; + goto cleanupunlock; if (req.socket.lock) ast_mutex_unlock(req.socket.lock); if (me->stop) @@ -2212,7 +2212,7 @@ if (req.socket.lock) ast_mutex_lock(req.socket.lock); if (!fread(buf, (cl < sizeof(buf)) ? cl : sizeof(buf), 1, ser->f)) - goto cleanup; + goto cleanupunlock; if (req.socket.lock) ast_mutex_unlock(req.socket.lock); if (me->stop) @@ -2226,6 +2226,9 @@ handle_request_do(&req, &ser->requestor); } +cleanupunlock: + if (req.socket.lock) + ast_mutex_unlock(req.socket.lock); cleanup: AST_LIST_LOCK(&threadl); AST_LIST_REMOVE(&threadl, me, list);