Change in libosmocore[master]: src/gsmtap_util.c: fix possible memleak in gsmtap_source_init()

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu Mar 28 10:07:59 UTC 2019


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13389 )

Change subject: src/gsmtap_util.c: fix possible memleak in gsmtap_source_init()
......................................................................

src/gsmtap_util.c: fix possible memleak in gsmtap_source_init()

In gsmtap_source_init() we dynamically allocate a gsmtap_inst struct,
but don't free it if the subsequent call to osmo_fd_register() fails.

Change-Id: I970b493f3a64fbe9c3f68fcfba5097ee3ff72960
---
M src/gsmtap_util.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c
index fd0bcc9..2fb18a4 100644
--- a/src/gsmtap_util.c
+++ b/src/gsmtap_util.c
@@ -440,6 +440,7 @@
 
 		rc = osmo_fd_register(&gti->wq.bfd);
 		if (rc < 0) {
+			talloc_free(gti);
 			close(fd);
 			return NULL;
 		}

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I970b493f3a64fbe9c3f68fcfba5097ee3ff72960
Gerrit-Change-Number: 13389
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190328/07dd4d17/attachment.htm>


More information about the gerrit-log mailing list