aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-07-14 13:28:27 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-07-15 15:39:33 +0200
commitb8ea0ff521a3e01c22a9dd1948b9a853521f575e (patch)
treedc9d8c4e1ec43f1a1ace002a9fef4038100ae5f7
parent5196cd56415e9fa97d78b92ea1803606205710c4 (diff)
ipaccess: Drop e1inp_line reference in ipacess_drop()
the bfd->data handles a reference to the e1np_line (obtained through e1inp_line_get() during bfd setup), so remember to drop it under this condition. Related: OS#4624 Change-Id: I418064df04872befe2e936e21768b6ea01263120
-rw-r--r--src/input/ipaccess.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 5d17839..08b34a4 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -92,6 +92,13 @@ static int ipaccess_drop(struct osmo_fd *bfd, struct e1inp_line *line)
osmo_fd_unregister(bfd);
close(bfd->fd);
bfd->fd = -1;
+ /* This is BSC code, ipaccess_drop() is only called for
+ accepted() sockets, hence the bfd holds a reference to
+ e1inp_line in ->data that needs to be released */
+ OSMO_ASSERT(bfd->data == line);
+ bfd->data = NULL;
+ e1inp_line_put2(line, "ipa_bfd");
+
ret = -ENOENT;
}