Merged revisions 222542 via svnmerge from
[asterisk/asterisk.git] / channels / chan_sip.c
index fbe07f3..047a86c 100644 (file)
@@ -19750,7 +19750,10 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in
                        can't harm */
                transmit_response_with_sdp(p, "200 OK", req, XMIT_RELIABLE, FALSE, FALSE);
                /* Do something more clever here */
-               ast_channel_unlock(c);
+               if (c) {
+                       *nounlock = 1;
+                       ast_channel_unlock(c);
+               }
                ast_channel_unlock(replacecall);
                sip_pvt_unlock(p->refer->refer_call);
                return 1;