diff options
author | Harald Welte <laforge@osmocom.org> | 2022-01-02 15:10:56 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-01-11 11:54:10 +0100 |
commit | 9dd73a16adeb6b540f70b3a5e4c2f93634b1d282 (patch) | |
tree | 25e678a09cdbc193a5d9cd43330e56b829912287 | |
parent | 0fdb143516884b47738885f693ca4a744f14dd8b (diff) |
om2000: Fix memory leak in OM2000 message handling
Change-Id: I7a94320f3b3af65003df67c11fe7221dfc7d7d62
-rw-r--r-- | src/osmo-bsc/abis_om2000.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index 8ee6371c0..16320fc07 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -3042,17 +3042,18 @@ int abis_om2k_rcvmsg(struct msgb *msg) if (!mo) { LOGP(DNM, LOGL_ERROR, "Couldn't resolve MO for OM2K msg " "%s: %s\n", get_value_string(om2k_msgcode_vals, msg_type), msgb_hexdump(msg)); - return 0; + goto no_mo; } if (!mo->fsm) { LOGP(DNM, LOGL_ERROR, "MO object should not generate any message. fsm == NULL " "%s: %s\n", get_value_string(om2k_msgcode_vals, msg_type), msgb_hexdump(msg)); - return 0; + goto no_mo; } /* Dispatch message to that MO */ om2k_mo_fsm_recvmsg(bts, mo, &odm); +no_mo: msgb_free(msg); return rc; } |