aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-04-12 21:29:43 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-04-12 21:29:43 +0700
commit720971c6a044611097d9f342b55d9168f6ce6efb (patch)
tree809e7a5cd4579a754af62022d63b29004bce6929 /src
parent620c74b7fec3df2f3a553070d23e5e633594d654 (diff)
common/pcu_sock.c: fix possible memleaks in pcu_sock_read()
Diffstat (limited to 'src')
-rw-r--r--src/common/pcu_sock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index d6946028..d496a492 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -790,14 +790,17 @@ static int pcu_sock_read(struct osmo_fd *bfd)
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;
}