Vadim Yanitskiy has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/13618/1

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: newchange
Gerrit-Change-Id: I58352e5f2b5715361c7089d0e134a42975171022
Gerrit-Change-Number: 13618
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <[email protected]>

Reply via email to