Change in osmo-mgw[master]: fix mgcp_conn_free_all

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

Hoernchen gerrit-no-reply at lists.osmocom.org
Thu Sep 9 14:06:40 UTC 2021


Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/25430 )


Change subject: fix mgcp_conn_free_all
......................................................................

fix mgcp_conn_free_all

It calls itself recursively which messes with the list an ep, so ubsan
complains.

Change-Id: If38ead0ba0c28396df2332990c98b2532cf17d1c
---
M src/libosmo-mgcp/mgcp_conn.c
1 file changed, 5 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/30/25430/1

diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 4acf18c..c43dfdc 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -325,14 +325,17 @@
 
 /*! free all connections at once.
  *  \param[in] endp associated endpoint */
-void mgcp_conn_free_all(struct mgcp_endpoint *endp)
+void mgcp_conn_free_all(struct mgcp_endpoint *endpx)
 {
 	struct mgcp_conn *conn;
 	struct mgcp_conn *conn_tmp;
+	struct mgcp_endpoint *endp = endpx;
 
-	/* Drop all items in the list */
+	/* Drop all items in the list, might be consecutive! */
+restart:
 	llist_for_each_entry_safe(conn, conn_tmp, &endp->conns, entry) {
 		mgcp_conn_free(endp, conn->id);
+		goto restart;
 	}
 
 	return;

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: If38ead0ba0c28396df2332990c98b2532cf17d1c
Gerrit-Change-Number: 25430
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210909/ab3eac48/attachment.htm>


More information about the gerrit-log mailing list