fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-pcap/+/42844?usp=email )


Change subject: server: fix msgb leak on duplicate link header
......................................................................

server: fix msgb leak on duplicate link header

rx_link_hdr() takes ownership of msg on success (rx_link() only frees
it on failure).  Both branches that call update_conn_file_hdr_msg()
free msg, but when an identical link header was already stored neither
branch ran and msg was leaked.

This happens on every duplicate PKT_LINK_HDR, e.g. a client that
periodically resends its header.  Free msg explicitly in that case.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Change-Id: I79344fe942342f2a736878142b3cf036fc982eef
---
M src/osmo_server_network.c
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/44/42844/1

diff --git a/src/osmo_server_network.c b/src/osmo_server_network.c
index 5c0fc36..90b8b54 100644
--- a/src/osmo_server_network.c
+++ b/src/osmo_server_network.c
@@ -173,6 +173,9 @@
                   memcmp(msgb_l2(conn->file_hdr_msg), msgb_l2(msg), 
msgb_l2len(msg)) != 0) {
                /* Client changed the link hdr in conn */
                update_conn_file_hdr_msg(conn, msg);
+       } else {
+               /* Identical link hdr already stored, nothing to do but free 
msg */
+               msgb_free(msg);
        }

        return 1;

--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/42844?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I79344fe942342f2a736878142b3cf036fc982eef
Gerrit-Change-Number: 42844
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>

Reply via email to