summaryrefslogtreecommitdiffstats
path: root/src/logicalfile/LMI_DirectoryContainsFileProvider.c
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2014-01-09 15:41:21 +0100
committerJan Synacek <jsynacek@redhat.com>2014-01-10 09:16:00 +0100
commit9019f10060080eff165c3e6aa3b6461748112ecc (patch)
tree0407d68fffe2b2958fb083f96b1f4fcadd10f408 /src/logicalfile/LMI_DirectoryContainsFileProvider.c
parent68567e7e27c66e499aed185c58503e65572c891a (diff)
downloadopenlmi-providers-9019f10060080eff165c3e6aa3b6461748112ecc.tar.gz
openlmi-providers-9019f10060080eff165c3e6aa3b6461748112ecc.tar.xz
openlmi-providers-9019f10060080eff165c3e6aa3b6461748112ecc.zip
logicalfile: don't automatically fill FSName and FSCreationClassName
Set there properties on output, meaning when GetInstance() is invoked, only when they are empty. Otherwise leave them unchanged.
Diffstat (limited to 'src/logicalfile/LMI_DirectoryContainsFileProvider.c')
-rw-r--r--src/logicalfile/LMI_DirectoryContainsFileProvider.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/logicalfile/LMI_DirectoryContainsFileProvider.c b/src/logicalfile/LMI_DirectoryContainsFileProvider.c
index 06810b7..366041b 100644
--- a/src/logicalfile/LMI_DirectoryContainsFileProvider.c
+++ b/src/logicalfile/LMI_DirectoryContainsFileProvider.c
@@ -42,8 +42,8 @@ static CMPIStatus logicalfile_objectpath_from_path(
CMPIStatus st = {.rc = CMPI_RC_OK};
char fileclass[BUFLEN];
- char *fsname;
- char *fsclassname;
+ char *fsname = NULL;
+ char *fsclassname = NULL;
if (lstat(abspath, &sb) < 0) {
char err[BUFLEN];
@@ -232,8 +232,8 @@ static CMPIStatus associators(
CIM_DirectoryRef lmi_dr;
CIM_DirectoryRef_Init(&lmi_dr, _cb, ns);
- char *fsname;
- char *fsclassname;
+ char *fsname = NULL;
+ char *fsclassname = NULL;
st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname);
check_status(st);
@@ -250,7 +250,6 @@ static CMPIStatus associators(
ci = _cb->bft->getInstance(_cb, cc, o, properties, &st);
CMReturnInstance(cr, ci);
}
- free(fsname);
} else {
/* this association does not associate with given 'cop' class */
CMReturn(CMPI_RC_OK);
@@ -272,8 +271,8 @@ static CMPIStatus references(
CMPIStatus st;
const char *ns = KNameSpace(cop);
const char *path;
- char *fsname;
- char *fsclassname;
+ char *fsname = NULL;
+ char *fsclassname = NULL;
char ccname[BUFLEN];
/* GroupComponent */
@@ -379,7 +378,6 @@ static CMPIStatus references(
CMReturn(CMPI_RC_OK);
}
- free(fsname);
CMReturn(CMPI_RC_OK);
}