From c234655395168838cc5be19bbb820fb8a444c3bf Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Thu, 30 Jun 2005 06:42:03 +0000 Subject: [PATCH] Fixed possible null pointer. --- chan_capi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chan_capi.c b/chan_capi.c index f157450..17c9bda 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -2252,8 +2252,8 @@ static void capi_handle_disconnect_indication(_cmsg *CMSG, unsigned int PLCI, un * in this case * did not read our hangup control frame * so we must hangup the channel! */ - if ( (p->i->state != CAPI_STATE_DISCONNECTED) && (p->i->state != CAPI_STATE_DISCONNECTING) && - (ast_check_hangup(p->c) == 0)) { + if ( (p->c) && (p->i->state != CAPI_STATE_DISCONNECTED) && + (p->i->state != CAPI_STATE_DISCONNECTING) && (ast_check_hangup(p->c) == 0)) { cc_ast_verbose(1, 0, VERBOSE_PREFIX_3 "soft hangup by capi\n"); ast_softhangup(p->c, AST_SOFTHANGUP_DEV); } else {