dexter has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bsc/+/29360 )
Change subject: pcu_sock: fix memleak
......................................................................
pcu_sock: fix memleak
pcu_sock_read() may not free the message buffer in case the recv
returned errno EAGAIN. This is already fixed in osmo-bts, lets fix it in
osmo-bsc as well.
Related: OS#5198
Change-Id: I49eda447fc1912c1f7f25ba07331cb84decf4548
---
M src/osmo-bsc/pcu_sock.c
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
neels: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index 45ff835..2cf1ab5 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -567,8 +567,10 @@
goto close;
if (rc < 0) {
- if (errno == EAGAIN)
+ if (errno == EAGAIN) {
+ msgb_free(msg);
return 0;
+ }
goto close;
}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/29360
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I49eda447fc1912c1f7f25ba07331cb84decf4548
Gerrit-Change-Number: 29360
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: merged