summaryrefslogtreecommitdiffstats
path: root/src/openlmi.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2013-11-21 15:41:56 +0100
committerTomas Bzatek <tbzatek@redhat.com>2013-11-21 15:41:56 +0100
commitebdda486484f5979fb81e9be7edde9e05d663612 (patch)
tree9cc3b7f2719cca3ee83954dc4b1560bc5978b574 /src/openlmi.c
parent524ee890b96e12cd78472c318d26f33d267297f1 (diff)
downloadopenlmi-providers-ebdda486484f5979fb81e9be7edde9e05d663612.tar.gz
openlmi-providers-ebdda486484f5979fb81e9be7edde9e05d663612.tar.xz
openlmi-providers-ebdda486484f5979fb81e9be7edde9e05d663612.zip
Plug some memory leaks
Diffstat (limited to 'src/openlmi.c')
-rw-r--r--src/openlmi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/openlmi.c b/src/openlmi.c
index a13fc50..de02d4f 100644
--- a/src/openlmi.c
+++ b/src/openlmi.c
@@ -81,9 +81,10 @@ static bool get_computer_system(const CMPIBroker *cb, const CMPIContext *ctx)
}
const char *class_name = lmi_get_system_creation_class_name();
- const char *namespace = lmi_read_config("CIM", "Namespace");
+ char *namespace = lmi_read_config("CIM", "Namespace");
CMPIStatus rc = { 0, NULL };
CMPIObjectPath *op = CMNewObjectPath(cb, namespace, class_name, &rc);
+ g_free (namespace);
if (rc.rc != CMPI_RC_OK) {
lmi_error("Unable to create object path: %s", rc.msg);
return false;
@@ -199,6 +200,7 @@ GKeyFile *parse_config(const char *provider_name, const ConfigEntry *provider_co
if ((providerKeyFile = g_key_file_new()) == NULL) {
lmi_error("Memory allocation failed");
g_key_file_free(masterKeyFile);
+ free(providerconf);
return NULL;
}
if (!g_key_file_load_from_file(providerKeyFile, providerconf, G_KEY_FILE_NONE, &error)) {
@@ -255,6 +257,7 @@ GKeyFile *parse_config(const char *provider_name, const ConfigEntry *provider_co
_toplevel_config_defaults[i].value);
}
}
+ free(providerconf);
return masterKeyFile;
}