Change in osmo-sysmon[master]: fix file descriptor leak in osysmon_file_read

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Stefan Sperling gerrit-no-reply at lists.osmocom.org
Tue Nov 27 10:55:23 UTC 2018


Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/11943


Change subject: fix file descriptor leak in osysmon_file_read
......................................................................

fix file descriptor leak in osysmon_file_read

Don't forget to close the file which was opened at the
beginning of this function's scope. Found by Coverity.

Change-Id: Ie1b5734748438c6d785cd96dfa9af6303cd102da
Related: CID#189756
---
M osysmon_file.c
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sysmon refs/changes/43/11943/1

diff --git a/osysmon_file.c b/osysmon_file.c
index 6f826b4..518b20d 100644
--- a/osysmon_file.c
+++ b/osysmon_file.c
@@ -93,6 +93,7 @@
 	while ((nl = strrchr(buf, '\n')))
 		*nl = '\0';
 	value_node_add(parent, parent, of->cfg.name, buf);
+	fclose(f);
 }
 
 /***********************************************************************

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

Gerrit-Project: osmo-sysmon
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1b5734748438c6d785cd96dfa9af6303cd102da
Gerrit-Change-Number: 11943
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling <ssperling at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181127/45dbe830/attachment.htm>


More information about the gerrit-log mailing list