Hello laforge,
I'd like you to do a code review. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/26872
to review the following change.
Change subject: om2000: Fix memory leak in OM2000 message handling ......................................................................
om2000: Fix memory leak in OM2000 message handling
Change-Id: I7a94320f3b3af65003df67c11fe7221dfc7d7d62 --- M src/osmo-bsc/abis_om2000.c 1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/72/26872/1
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index 8ee6371..16320fc 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -3042,17 +3042,18 @@ 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; }
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/26872 )
Change subject: om2000: Fix memory leak in OM2000 message handling ......................................................................
Patch Set 1: Code-Review+2
woudln't have been critical to fix, but as you already have it in the branch...
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/26872 )
Change subject: om2000: Fix memory leak in OM2000 message handling ......................................................................
Patch Set 1:
The patch is really scope-constraint, small and clear, so it makes sense adding it imho.
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/26872 )
Change subject: om2000: Fix memory leak in OM2000 message handling ......................................................................
om2000: Fix memory leak in OM2000 message handling
Change-Id: I7a94320f3b3af65003df67c11fe7221dfc7d7d62 --- M src/osmo-bsc/abis_om2000.c 1 file changed, 3 insertions(+), 2 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index 8ee6371..16320fc 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -3042,17 +3042,18 @@ 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; }