laforge has submitted this change. ( 
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, 2 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  dexter: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 4acf18c..4f6e1a2 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -328,12 +328,10 @@
 void mgcp_conn_free_all(struct mgcp_endpoint *endp)
 {
        struct mgcp_conn *conn;
-       struct mgcp_conn *conn_tmp;

-       /* Drop all items in the list */
-       llist_for_each_entry_safe(conn, conn_tmp, &endp->conns, entry) {
+       /* Drop all items in the list, might be consecutive! */
+       while ((conn = llist_first_entry_or_null(&endp->conns, struct 
mgcp_conn, entry)))
                mgcp_conn_free(endp, conn->id);
-       }

        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: 19
Gerrit-Owner: Hoernchen <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to