Change in libosmo-sccp[master]: xua_msg: Avoid memleaking xua_msg_part in xua_msg_free

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

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon Aug 13 16:17:23 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10442


Change subject: xua_msg: Avoid memleaking xua_msg_part in xua_msg_free
......................................................................

xua_msg: Avoid memleaking xua_msg_part in xua_msg_free

Change-Id: If9ca8aea50b3715890b9ea0290471e95caed4624
---
M src/xua_msg.c
1 file changed, 7 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/42/10442/1

diff --git a/src/xua_msg.c b/src/xua_msg.c
index ed0cdc7..3bd6a6d 100644
--- a/src/xua_msg.c
+++ b/src/xua_msg.c
@@ -27,6 +27,7 @@
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/logging.h>
 #include <osmocom/core/talloc.h>
+#include <osmocom/core/linuxlist.h>
 
 #include <arpa/inet.h>
 
@@ -55,6 +56,12 @@
 
 void xua_msg_free(struct xua_msg *msg)
 {
+	struct xua_msg_part *part, *tmp;
+	llist_for_each_entry_safe(part, tmp, &msg->headers, entry) {
+		llist_del(&part->entry);
+		talloc_free(part);
+	}
+
 	talloc_free(msg);
 }
 

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If9ca8aea50b3715890b9ea0290471e95caed4624
Gerrit-Change-Number: 10442
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180813/d6bcca54/attachment.htm>


More information about the gerrit-log mailing list