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
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))