summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-07-21 08:12:59 +0200
committerHarald Welte <laforge@gnumonks.org>2019-07-21 08:12:59 +0200
commit5b759f7f1e1997be5588546358ee86585953e82c (patch)
tree13c30f3e071bfa57cadc0171fff774db0aa72e1e /src
parent7f7a7c850e404d24cd3bc9d2b9b408287e4e0ba0 (diff)
osmocon: Fix fd leak in error path of read_file()
Change-Id: Iaae407658df184277f6e6e07d6a48d8b5c75587b Closes: CID#198552
Diffstat (limited to 'src')
-rw-r--r--src/host/osmocon/osmocon.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index 9090d276..92372141 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -290,6 +290,7 @@ int read_file(const char *filename, int chainload)
if ((st.st_size > MAX_DNLOAD_SIZE) && (dnload.mode != MODE_ROMLOAD)) {
fprintf(stderr, "The maximum file size is 64kBytes (%u bytes)\n",
MAX_DNLOAD_SIZE);
+ close(fd);
return -EFBIG;
}
} else {