neels submitted this change.

View Change


Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified
fix msgb leak on OSMO_STREAM_SRV_F_FLUSH_DESTROY

In osmo_stream_srv_send(), call msgb_free() if the msgb is not enqueued.

Before this, osmo_stream_srv_send() enqueues a msgb, assuming the queue
will free it. But if OSMO_STREAM_SRV_F_FLUSH_DESTROY is set, it just
returns and drops the msgb. There is no rc, so the caller cannot know.

Change-Id: I994c5e06a9030cfbf4fca8ab42588c61f7121cee
---
M src/stream.c
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/stream.c b/src/stream.c
index 172a299..cbf0b27 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1507,6 +1507,7 @@
OSMO_ASSERT(msg);
if (conn->flags & OSMO_STREAM_SRV_F_FLUSH_DESTROY) {
LOGP(DLINP, LOGL_DEBUG, "Connection is being flushed and closed; ignoring new outgoing message\n");
+ msgb_free(msg);
return;
}


To view, visit change 31368. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I994c5e06a9030cfbf4fca8ab42588c61f7121cee
Gerrit-Change-Number: 31368
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged