Change in ...osmo-remsim[master]: rspro_client_fsm: Fix another memory leak

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Jul 24 16:44:11 UTC 2019


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/14929


Change subject: rspro_client_fsm: Fix another memory leak
......................................................................

rspro_client_fsm: Fix another memory leak

We basically must ensure that all code paths *except* the path leading
to rspro_dec_msg() must call msgb_free(msg).  This was not the case
in two situations, as fixed now.

Change-Id: I29f8413bb43b3ebf827be0bceda1a4db1e6e2b7c
---
M src/rspro_client_fsm.c
1 file changed, 4 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/29/14929/1

diff --git a/src/rspro_client_fsm.c b/src/rspro_client_fsm.c
index 06364da..d487f32 100644
--- a/src/rspro_client_fsm.c
+++ b/src/rspro_client_fsm.c
@@ -121,8 +121,10 @@
 	switch (hh->proto) {
 	case IPAC_PROTO_IPACCESS:
 		rc = ipaccess_bts_handle_ccm(srvc->conn, &srvc->ipa_dev, msg);
-		if (rc < 0)
+		if (rc < 0) {
+			msgb_free(msg);
 			break;
+		}
 		switch (hh->data[0]) {
 		case IPAC_MSGT_PONG:
 			ipa_keepalive_fsm_pong_received(srvc->keepalive_fi);
@@ -130,8 +132,8 @@
 			break;
 		default:
 			break;
-		msgb_free(msg);
 		}
+		msgb_free(msg);
 		break;
 	case IPAC_PROTO_OSMO:
 		if (!he || msgb_l2len(msg) < sizeof(*he))

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/14929
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I29f8413bb43b3ebf827be0bceda1a4db1e6e2b7c
Gerrit-Change-Number: 14929
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at gnumonks.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190724/6bd8c279/attachment.htm>


More information about the gerrit-log mailing list