diff --git a/main/cel.c b/main/cel.c index bc16656a5ed39d39f710dbbc4c799d9ce43fd0ca..9fe9993a0493c842401d0fc10291f480ceb52a21 100644 --- a/main/cel.c +++ b/main/cel.c @@ -483,6 +483,9 @@ int ast_cel_report_event(struct ast_channel *chan, enum ast_cel_event_type event if (!cel_enabled || !ast_cel_track_event(event_type)) { ast_mutex_unlock(&reload_lock); + if (peer) { + ast_channel_unref(peer); + } return 0; } @@ -490,6 +493,9 @@ int ast_cel_report_event(struct ast_channel *chan, enum ast_cel_event_type event char *app; if (!(app = ao2_find(appset, (char *) chan->appl, OBJ_POINTER))) { ast_mutex_unlock(&reload_lock); + if (peer) { + ast_channel_unref(peer); + } return 0; } ao2_ref(app, -1);