summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--channels/chan_sip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 8d531c4a9..fa6b6ea4c 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -26001,11 +26001,13 @@ static int sip_send_mwi_to_peer(struct sip_peer *peer, int cache_only)
/* Called with peerl lock, but releases it */
struct sip_pvt *p;
int newmsgs = 0, oldmsgs = 0;
- const char *vmexten;
+ const char *vmexten = NULL;
ao2_lock(peer);
- vmexten = ast_strdupa(peer->vmexten);
+ if (peer->vmexten) {
+ vmexten = ast_strdupa(peer->vmexten);
+ }
if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY) && !peer->mwipvt) {
ao2_unlock(peer);