summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-07-21 08:29:34 +0200
committerHarald Welte <laforge@gnumonks.org>2019-07-21 08:29:34 +0200
commit5c2a64ca96b123fbfa317ada473e6f22819dabdc (patch)
treec12f3ec5b4e96145cea707120f50e1cb337a4312 /src
parent5b759f7f1e1997be5588546358ee86585953e82c (diff)
gsm322: Fix resource leak in gsm322_init() while reading BA
Change-Id: Id42102ab8581e247f495fb7e05dc62a6743d28c5 Closes: CID#198546
Diffstat (limited to 'src')
-rw-r--r--src/host/layer23/src/mobile/gsm322.c4
1 files changed, 3 insertions, 1 deletions
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 @@ int gsm322_init(struct osmocom_ms *ms)
} 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);