Change in libosmo-abis[master]: ipaccess: Set bfd->data to NULL before releasing its reference

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/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Jul 14 19:52:37 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/19259 )


Change subject: ipaccess: Set bfd->data to NULL before releasing its reference
......................................................................

ipaccess: Set bfd->data to NULL before releasing its reference

Since the reference is dropped, make sure no one accesses it through
that pointer anymore. It must be done before calling the put() method,
otherwise it may already be released when put() returns.

Change-Id: Ic3f261b2a995efcbc8eece9669ee3ae63af7b5c0
---
M src/input/ipaccess.c
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/59/19259/1

diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 4d55e71..3ff59f4 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -661,6 +661,7 @@
 err_line:
 	close(bfd->fd);
 	bfd->fd = -1;
+	bfd->data = NULL;
 	e1inp_line_put2(line, "ipa_bfd");
 	return ret;
 }
@@ -711,6 +712,7 @@
 err_line:
 	close(bfd->fd);
 	bfd->fd = -1;
+	bfd->data = NULL;
 	e1inp_line_put2(line, "ipa_bfd");
 	return ret;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/19259
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ic3f261b2a995efcbc8eece9669ee3ae63af7b5c0
Gerrit-Change-Number: 19259
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200714/dcd1379c/attachment.htm>


More information about the gerrit-log mailing list