Change in ...osmocom-bb[master]: osmocon: Fix fd leak in error path of read_file()

laforge gerrit-no-reply at lists.osmocom.org
Sun Jul 21 07:22:15 UTC 2019


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14850


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

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

Change-Id: Iaae407658df184277f6e6e07d6a48d8b5c75587b
Closes: CID#198552
---
M src/host/osmocon/osmocon.c
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/50/14850/1

diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index 9090d27..9237214 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -290,6 +290,7 @@
 		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 {

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Iaae407658df184277f6e6e07d6a48d8b5c75587b
Gerrit-Change-Number: 14850
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/c1f60794/attachment.html>


More information about the gerrit-log mailing list