pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-mgw/+/29312 )
Change subject: osmux: Fix memleak on error code path
......................................................................
osmux: Fix memleak on error code path
Change-Id: Ib84f78a53293799b925b645156513e129c32c705
---
M src/libosmo-mgcp/mgcp_osmux.c
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/12/29312/1
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index b393c2d..d9bccb4 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -192,6 +192,12 @@
int ret;
struct msgb *msg;
+ if (conn->osmux.state != OSMUX_STATE_ENABLED) {
+ LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, "forwarding RTP to Osmux conn not yet
enabled, dropping (cid=%d)\n",
+ conn->osmux.cid);
+ return -1;
+ }
+
msg = msgb_alloc(4096, "RTP");
if (!msg)
return -1;
@@ -199,12 +205,6 @@
memcpy(msg->data, buf, buf_len);
msgb_put(msg, buf_len);
- if (conn->osmux.state != OSMUX_STATE_ENABLED) {
- LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, "forwarding RTP to Osmux conn not yet
enabled, dropping (cid=%d)\n",
- conn->osmux.cid);
- return -1;
- }
-
while ((ret = osmux_xfrm_input(conn->osmux.in, msg, conn->osmux.cid)) > 0) {
/* batch full, build and deliver it */
osmux_xfrm_input_deliver(conn->osmux.in);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-mgw/+/29312
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib84f78a53293799b925b645156513e129c32c705
Gerrit-Change-Number: 29312
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange