Change in osmo-bts[master]: common/pcu_sock.c: fix possible memleaks in pcu_sock_read()

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Apr 12 15:11:35 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13618 )

Change subject: common/pcu_sock.c: fix possible memleaks in pcu_sock_read()
......................................................................

common/pcu_sock.c: fix possible memleaks in pcu_sock_read()

Change-Id: I58352e5f2b5715361c7089d0e134a42975171022
---
M src/common/pcu_sock.c
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, approved
  Harald Welte: Looks good to me, approved



diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index d694602..d496a49 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -790,14 +790,17 @@
 		goto close;
 
 	if (rc < 0) {
-		if (errno == EAGAIN)
+		if (errno == EAGAIN) {
+			msgb_free(msg);
 			return 0;
+		}
 		goto close;
 	}
 
 	if (rc < sizeof(*pcu_prim)) {
 		LOGP(DPCU, LOGL_ERROR, "Received %d bytes on PCU Socket, but primitive size "
 			"is %lu, discarding\n", rc, sizeof(*pcu_prim));
+		msgb_free(msg);
 		return 0;
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/13618
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I58352e5f2b5715361c7089d0e134a42975171022
Gerrit-Change-Number: 13618
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190412/cc860980/attachment.html>


More information about the gerrit-log mailing list