diff options
-rw-r--r-- | channels/chan_sip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c54224570..9bc15bbbc 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4752,6 +4752,11 @@ static int sip_queryoption(struct ast_channel *chan, int option, void *data, int struct sip_pvt *p = (struct sip_pvt *) ast_channel_tech_pvt(chan); char *cp; + if (!p) { + ast_debug(1, "Attempt to Ref a null pointer. Sip private structure is gone!\n"); + return -1; + } + sip_pvt_lock(p); switch (option) { |