From 5b759f7f1e1997be5588546358ee86585953e82c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 21 Jul 2019 08:12:59 +0200 Subject: osmocon: Fix fd leak in error path of read_file() Change-Id: Iaae407658df184277f6e6e07d6a48d8b5c75587b Closes: CID#198552 --- src/host/osmocon/osmocon.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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 { -- cgit v1.2.3