Change in ...libosmo-abis[master]: ipaccess.c: Avoid calling close(-1) on error path

laforge gerrit-no-reply at lists.osmocom.org
Sun Jul 21 09:53:26 UTC 2019


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/14870


Change subject: ipaccess.c: Avoid calling close(-1) on error path
......................................................................

ipaccess.c: Avoid calling close(-1) on error path

Change-Id: Idabb9805a4a10c95ba0e01bc3f80ed8db87a9f85
Closes: CID#157118
---
M src/input/ipaccess.c
1 file changed, 4 insertions(+), 2 deletions(-)



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

diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 136aa79..0d6d55d 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -215,8 +215,10 @@
 	return 0;
 err:
 	osmo_fd_unregister(bfd);
-	close(bfd->fd);
-	bfd->fd = -1;
+	if (bfd->fd != -1) {
+		close(bfd->fd);
+		bfd->fd = -1;
+	}
 	e1inp_line_put(line);
 	return -1;
 }

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

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Idabb9805a4a10c95ba0e01bc3f80ed8db87a9f85
Gerrit-Change-Number: 14870
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at gnumonks.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190721/441bc72e/attachment.html>


More information about the gerrit-log mailing list