diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2013-11-21 15:41:56 +0100 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2013-11-21 15:41:56 +0100 |
commit | ebdda486484f5979fb81e9be7edde9e05d663612 (patch) | |
tree | 9cc3b7f2719cca3ee83954dc4b1560bc5978b574 /src | |
parent | 524ee890b96e12cd78472c318d26f33d267297f1 (diff) | |
download | openlmi-providers-ebdda486484f5979fb81e9be7edde9e05d663612.tar.gz openlmi-providers-ebdda486484f5979fb81e9be7edde9e05d663612.tar.xz openlmi-providers-ebdda486484f5979fb81e9be7edde9e05d663612.zip |
Plug some memory leaks
Diffstat (limited to 'src')
-rw-r--r-- | src/openlmi.c | 5 |
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; } |