Change in ...osmocom-bb[master]: osmocon: Fix file descriptor + mem leak in error path

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/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Jul 21 07:22:16 UTC 2019


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14852


Change subject: osmocon: Fix file descriptor + mem leak in error path
......................................................................

osmocon: Fix file descriptor + mem leak in error path

Change-Id: I42ceed662889084783dc89f4ca39c3852428d108
Closes: CID#198539
---
M src/host/osmocon/osmocon.c
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/52/14852/1

diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index 9237214..1bb0bb7 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -1309,6 +1309,7 @@
 	con = talloc_zero(NULL, struct tool_connection);
 	if (!con) {
 		fprintf(stderr, "Failed to create tool connection.\n");
+		close(rc);
 		return -1;
 	}
 
@@ -1320,6 +1321,8 @@
 	con->fd.data = con;
 	if (osmo_fd_register(&con->fd) != 0) {
 		fprintf(stderr, "Failed to register the fd.\n");
+		talloc_free(con);
+		close(rc);
 		return -1;
 	}
 

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I42ceed662889084783dc89f4ca39c3852428d108
Gerrit-Change-Number: 14852
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/65627973/attachment.htm>


More information about the gerrit-log mailing list