File 0001-Missing-fclose-fix.patch of Package sblim-cmpi-nfsv3
From 6d06b5b1dd12bf73be2673016d6536265854f084 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Wed, 3 Aug 2011 12:57:51 +0200
Subject: [PATCH 1/2] Missing fclose fix
fclose was not called when valid_file() returned -1 (the file was
correctly opened).
---
util/Linux_NFSv3SystemConfigurationUtil.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/util/Linux_NFSv3SystemConfigurationUtil.c b/util/Linux_NFSv3SystemConfigurationUtil.c
index 546c7e0..c40b53b 100644
--- a/util/Linux_NFSv3SystemConfigurationUtil.c
+++ b/util/Linux_NFSv3SystemConfigurationUtil.c
@@ -448,6 +448,8 @@ void * Linux_NFSv3_startReadingInstances()
/* If etab file doesn't exist or is zero bytes, use exports */
if ( ((sourcefile = fopen(_CONFIGFILE_ETAB, "r")) == NULL) ||
(valid_file(_CONFIGFILE_ETAB) == -1) ) {
+ if (sourcefile)
+ fclose(sourcefile);
_OSBASE_TRACE(4,("startReadingInstances() : %s not found or contains no entries. Using /etc/exports", _CONFIGFILE_ETAB));
if ((sourcefile = fopen(_CONFIGFILE,"r")) == NULL) {
_OSBASE_TRACE(1,("startReadingInstances() : Cannot read from config file %s", _CONFIGFILE));
--
1.7.3.1