diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 241629200204dfd81d8163abfe8119c07f5ef035..cba099c6393656d3778aecdbda0ad2b276079dda 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -3065,6 +3065,10 @@ static int skinny_hold(struct skinny_subchannel *sub) struct skinnysession *s = d->session; struct skinny_req *req; + /* Don't try to hold a channel that doesn't exist */ + if (!sub || !sub->owner) + return 0; + /* Channel needs to be put on hold */ if (skinnydebug) ast_verbose("Putting on Hold(%d)\n", l->instance); @@ -3105,6 +3109,10 @@ static int skinny_unhold(struct skinny_subchannel *sub) struct skinnysession *s = d->session; struct skinny_req *req; + /* Don't try to unhold a channel that doesn't exist */ + if (!sub || !sub->owner) + return 0; + /* Channel is on hold, so we will unhold */ if (skinnydebug) ast_verbose("Taking off Hold(%d)\n", l->instance);