pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-netif/+/36573?usp=email )
Change subject: examples/ipa-stream-client: Fix memleaks in read_cb()
......................................................................
examples/ipa-stream-client: Fix memleaks in read_cb()
Change-Id: I86fc159d928fc7ebce2f771670c5a198c52f5fc0
---
M examples/ipa-stream-client.c
1 file changed, 14 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/73/36573/1
diff --git a/examples/ipa-stream-client.c b/examples/ipa-stream-client.c
index cb07ef6..720fe66 100644
--- a/examples/ipa-stream-client.c
+++ b/examples/ipa-stream-client.c
@@ -104,16 +104,17 @@
static int read_cb(struct osmo_stream_cli *conn, struct msgb *msg)
{
+ int num;
+ struct msg_sent *cur, *tmp, *found = NULL;
+
LOGP(DIPATEST, LOGL_DEBUG, "received message from stream (payload len=%d)\n",
msgb_length(msg));
if (osmo_ipa_process_msg(msg) < 0) {
LOGP(DIPATEST, LOGL_ERROR, "bad IPA message\n");
+ msgb_free(msg);
return 0;
}
- int num;
- struct msg_sent *cur, *tmp, *found = NULL;
-
num = osmo_load32be(msg->data);
LOGP(DLINP, LOGL_DEBUG, "received msg number %d\n", num);
@@ -137,6 +138,7 @@
LOGP(DLINP, LOGL_ERROR,
"message %d not found!\n", num);
}
+ msgb_free(msg);
return 0;
}
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-netif/+/36573?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I86fc159d928fc7ebce2f771670c5a198c52f5fc0
Gerrit-Change-Number: 36573
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange