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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sat Mar 23 17:57:15 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/13389/1

diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c
index 996830f..b04d87f 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: newchange
Gerrit-Change-Id: I970b493f3a64fbe9c3f68fcfba5097ee3ff72960
Gerrit-Change-Number: 13389
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190323/919c00ae/attachment-0001.html>


More information about the gerrit-log mailing list