gsup_server: fix msgb memleak in osmo_gsup_server_read_cb()

I noticed that inability to send IPA PONG in response to IPA PING
from osmo-{msc,sgsn} results in an "IPA Multiplex" chunk being leaked.

No matter what's returned from ipa_server_conn_ccm(), we need to free
the msgb containing the incoming IPA message.

Change-Id: I5c5acbffc2913f78db4894ae3633b5eca9c2e8d6
This commit is contained in:
Vadim Yanitskiy 2023-07-05 01:06:20 +07:00
parent f4223f5b53
commit f8b73f0682
1 changed files with 2 additions and 4 deletions

View File

@ -179,11 +179,9 @@ static int osmo_gsup_server_read_cb(struct ipa_server_conn *conn,
if (hh->proto == IPAC_PROTO_IPACCESS) {
rc = ipa_server_conn_ccm(conn, msg);
if (rc < 0) {
/* conn is already invalid here! */
return -1;
}
msgb_free(msg);
if (rc < 0) /* conn is already invalid here! */
return -1;
return 0;
}