[PATCH 02/11] ipaccess: fix leak of e1inp_line

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

pablo at gnumonks.org pablo at gnumonks.org
Wed Aug 22 15:04:44 UTC 2012


From: Pablo Neira Ayuso <pablo at gnumonks.org>

Holger reported a leak in the ipaccess_drop path. It seems I forgot
to call e1inp_line_put twice, one for the OML link and one for the
RSL link.

Note that, for some fully established A-bis IPA link, the refcnt
of the e1inp_line becomes two.
---
 src/input/ipaccess.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 76d1994..44a5a59 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -250,7 +250,10 @@ static int ipaccess_drop(struct osmo_fd *bfd)
 		ret = -ENOENT;
 	}
 	/* put the virtual E1 line that we cloned for this socket, if
-	 * it becomes unused, it gets released. */
+	 * it becomes unused, it gets released. We have to make it
+	 * twice: once for the OML link and once for the RSL link
+	 */
+	e1inp_line_put(line);
 	e1inp_line_put(line);
 	return ret;
 }
-- 
1.7.10.4





More information about the OpenBSC mailing list