common/pcu_sock.c: fix possible memleaks in pcu_sock_read()
Change-Id: I58352e5f2b5715361c7089d0e134a42975171022
This commit is contained in:
parent
620c74b7fe
commit
720971c6a0
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue