From 8c69e29820860975cd398a42a681c2c6c4787ed8 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 19 Sep 2019 03:05:00 +0200 Subject: [PATCH] mgcp_client_fsm cleanup: Do not assert on DLCX failure During FSM instance cleanup, a DLCX message composition may fail if a preceding received MGCP message was missing parameters. If that occurs, don't crash, just log an error and deallocate. Change-Id: Ic1c3c4deeb4703b60e870af9d5d7be216a87fff8 --- src/libosmo-mgcp-client/mgcp_client_fsm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c index e83a11947..7565d3283 100644 --- a/src/libosmo-mgcp-client/mgcp_client_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -525,8 +525,10 @@ static void fsm_cleanup_cb(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause ca LOGPFSML(fi, LOGL_ERROR, "MGW/DLCX: abrupt FSM termination with connections still present, sending unconditional DLCX...\n"); msg = make_dlcx_msg(mgcp_ctx); - OSMO_ASSERT(msg); - mgcp_client_tx(mgcp, msg, NULL, NULL); + if (!msg) + LOGPFSML(fi, LOGL_ERROR, "MGW/DLCX: Error composing DLCX message\n"); + else + mgcp_client_tx(mgcp, msg, NULL, NULL); } talloc_free(mgcp_ctx);