summaryrefslogtreecommitdiffstats
path: root/src/logicalfile
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2013-10-02 12:26:40 +0200
committerJan Synacek <jsynacek@redhat.com>2013-10-02 13:26:23 +0200
commit97057c2681746ad93c3627c5eedc8385c162c032 (patch)
tree52856a4d58e018afd37bd7c7210809ab12cd917d /src/logicalfile
parent97a856311031d688180fc4e68faf4e95c5b46a84 (diff)
downloadopenlmi-providers-97057c2681746ad93c3627c5eedc8385c162c032.tar.gz
openlmi-providers-97057c2681746ad93c3627c5eedc8385c162c032.tar.xz
openlmi-providers-97057c2681746ad93c3627c5eedc8385c162c032.zip
logicalfile: fix resource leak
Diffstat (limited to 'src/logicalfile')
-rw-r--r--src/logicalfile/LMI_DirectoryContainsFileProvider.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/logicalfile/LMI_DirectoryContainsFileProvider.c b/src/logicalfile/LMI_DirectoryContainsFileProvider.c
index a2de4b9..1be5eb2 100644
--- a/src/logicalfile/LMI_DirectoryContainsFileProvider.c
+++ b/src/logicalfile/LMI_DirectoryContainsFileProvider.c
@@ -44,7 +44,7 @@ static CMPIStatus dir_file_objectpaths(
unsigned int *count)
{
CMPIObjectPath *o;
- CMPIStatus st;
+ CMPIStatus st = {.rc = CMPI_RC_OK};
unsigned int i = 0;
struct stat sb;
@@ -91,15 +91,14 @@ static CMPIStatus dir_file_objectpaths(
} else {
get_class_from_stat(&sb, fileclass);
st = check_assoc_class(_cb, namespace, resultClass, fileclass);
- check_class_check_status(st);
- if (st.rc != CMPI_RC_OK) {
- closedir(dp);
- return st;
+ if (st.rc == RC_ERR_CLASS_CHECK_FAILED) {
+ CMReturn(CMPI_RC_OK);
+ } else if (st.rc != CMPI_RC_OK) {
+ goto done;
}
st = get_fsname_from_stat(_cb, &sb, &fsname);
if (st.rc != CMPI_RC_OK) {
- closedir(dp);
- return st;
+ goto done;
}
}
@@ -113,8 +112,9 @@ static CMPIStatus dir_file_objectpaths(
free(fsname);
}
*count = i;
+done:
closedir(dp);
- CMReturn(CMPI_RC_OK);
+ return st;
}
static CMPIStatus associators(