Change in libosmocore[master]: ns2: Fix memory leak in IP-SNS

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/.

daniel gerrit-no-reply at lists.osmocom.org
Sun Jan 17 13:27:33 UTC 2021


daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/22255 )


Change subject: ns2: Fix memory leak in IP-SNS
......................................................................

ns2: Fix memory leak in IP-SNS

Don't allocate msg twice - it's not nice.

Change-Id: I3fa0076eb480a7bcadb74cc86760dc29b77ac600
Related: OS#4874
---
M src/gb/gprs_ns2_message.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/22255/1

diff --git a/src/gb/gprs_ns2_message.c b/src/gb/gprs_ns2_message.c
index eb9a198..6c7f08f 100644
--- a/src/gb/gprs_ns2_message.c
+++ b/src/gb/gprs_ns2_message.c
@@ -498,7 +498,7 @@
 			const struct gprs_ns_ie_ip6_elem *ip6_elems,
 			unsigned int num_ip6_elems)
 {
-	struct msgb *msg = gprs_ns2_msgb_alloc();
+	struct msgb *msg;
 	struct gprs_ns_hdr *nsh;
 	uint16_t nsei;
 
@@ -652,7 +652,7 @@
 int ns2_tx_sns_size(struct gprs_ns2_vc *nsvc, bool reset_flag, uint16_t max_nr_nsvc,
 			 int ip4_ep_nr, int ip6_ep_nr)
 {
-	struct msgb *msg = gprs_ns2_msgb_alloc();
+	struct msgb *msg;
 	struct gprs_ns_hdr *nsh;
 	uint16_t nsei;
 

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3fa0076eb480a7bcadb74cc86760dc29b77ac600
Gerrit-Change-Number: 22255
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210117/d1aa26c6/attachment.htm>


More information about the gerrit-log mailing list