laforge has submitted this change. ( 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(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved
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; }