Change in osmo-sgsn[master]: Fix memory leak when SNDCP de-fragmentation is used

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
Mon Jun 8 18:48:16 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/18733 )


Change subject: Fix memory leak when SNDCP de-fragmentation is used
......................................................................

Fix memory leak when SNDCP de-fragmentation is used

As msgb ownership is not passed along, we need to free the message
buffer memory we allocate in defrag_segments() after calling
sgsn_rx_sndcp_ud_ind().

Change-Id: I1185b1aa99bb167d616eb469e5445e4ed5ad949d
Closes: OS#4603
---
M src/sgsn/gprs_sndcp.c
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/33/18733/1

diff --git a/src/sgsn/gprs_sndcp.c b/src/sgsn/gprs_sndcp.c
index 01be57e..7ce6960 100644
--- a/src/sgsn/gprs_sndcp.c
+++ b/src/sgsn/gprs_sndcp.c
@@ -366,6 +366,10 @@
 	rc = sgsn_rx_sndcp_ud_ind(&sne->ra_id, sne->lle->llme->tlli,
 				  sne->nsapi, msg, npdu_len, expnd);
 
+	/* we must free the memory we allocated above; ownership is not transferred
+	 * downwards in the call above */
+	msgb_free(msg);
+
 	if (any_pcomp_or_dcomp_active(sgsn))
 		talloc_free(expnd);
 

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I1185b1aa99bb167d616eb469e5445e4ed5ad949d
Gerrit-Change-Number: 18733
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200608/0a476e2b/attachment.htm>


More information about the gerrit-log mailing list