Change in ...osmocom-bb[master]: gsm322: Fix resource leak in gsm322_init() while reading BA

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/+/14851


Change subject: gsm322: Fix resource leak in gsm322_init() while reading BA
......................................................................

gsm322: Fix resource leak in gsm322_init() while reading BA

Change-Id: Id42102ab8581e247f495fb7e05dc62a6743d28c5
Closes: CID#198546
---
M src/host/layer23/src/mobile/gsm322.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/51/14851/1

diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c
index cfd70d8..56dd236 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -5085,8 +5085,10 @@
 		} else
 		while(!feof(fp)) {
 			ba = talloc_zero(ms, struct gsm322_ba_list);
-			if (!ba)
+			if (!ba) {
+				fclose(fp);
 				return -ENOMEM;
+			}
 			rc = fread(buf, 4, 1, fp);
 			if (!rc) {
 				talloc_free(ba);

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Id42102ab8581e247f495fb7e05dc62a6743d28c5
Gerrit-Change-Number: 14851
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/40dacc63/attachment.html>


More information about the gerrit-log mailing list