osmocon: Fix fd leak in error path of read_file()

Change-Id: Iaae407658df184277f6e6e07d6a48d8b5c75587b
Closes: CID#198552
This commit is contained in:
Harald Welte 2019-07-21 08:12:59 +02:00
parent 7f7a7c850e
commit 5b759f7f1e
1 changed files with 1 additions and 0 deletions

View File

@ -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 {