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
This commit is contained in:
Philipp Maier 2022-09-15 12:10:32 +02:00
parent d8b5bf08e8
commit e71af5019b
1 changed files with 3 additions and 1 deletions

View File

@ -567,8 +567,10 @@ 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;
}