diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2013-11-21 15:43:22 +0100 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2013-11-21 15:43:22 +0100 |
commit | c5060e93a6f57badce71ab6e3ca567ced8fb3f29 (patch) | |
tree | e45245a852b9cff8edeeb30a7d0e44399ca282de /src/account | |
parent | 52cdb2a9c497ed3d19ee5d563594f7251b2e43eb (diff) | |
download | openlmi-providers-c5060e93a6f57badce71ab6e3ca567ced8fb3f29.tar.gz openlmi-providers-c5060e93a6f57badce71ab6e3ca567ced8fb3f29.tar.xz openlmi-providers-c5060e93a6f57badce71ab6e3ca567ced8fb3f29.zip |
account: Fix some memory leaks
GValue memory management is tricky...
Diffstat (limited to 'src/account')
-rw-r--r-- | src/account/LMI_AccountProvider.c | 3 | ||||
-rw-r--r-- | src/account/LMI_AssignedGroupIdentityProvider.c | 2 | ||||
-rw-r--r-- | src/account/LMI_GroupProvider.c | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/account/LMI_AccountProvider.c b/src/account/LMI_AccountProvider.c index da7f970..35c870f 100644 --- a/src/account/LMI_AccountProvider.c +++ b/src/account/LMI_AccountProvider.c @@ -365,9 +365,11 @@ static CMPIStatus LMI_AccountModifyInstance( } #define PARAMSTR(ATTR, VAR)\ + g_value_init(&val, G_TYPE_STRING);\ g_value_set_string(&val, (VAR));\ lu_ent_clear(lue, (ATTR));\ lu_ent_add(lue, (ATTR), &val);\ + g_value_unset(&val);\ #define PARAMLONG(ATTR, VAR)\ if (!(VAR).null) {\ @@ -393,7 +395,6 @@ static CMPIStatus LMI_AccountModifyInstance( /* First string values */ memset(&val, 0, sizeof(val)); - g_value_init(&val, G_TYPE_STRING); GETSTRVALUE("ElementName"); PARAMSTR(LU_GECOS, value); diff --git a/src/account/LMI_AssignedGroupIdentityProvider.c b/src/account/LMI_AssignedGroupIdentityProvider.c index 5b673db..bfdb7a2 100644 --- a/src/account/LMI_AssignedGroupIdentityProvider.c +++ b/src/account/LMI_AssignedGroupIdentityProvider.c @@ -103,6 +103,8 @@ static CMPIStatus LMI_AssignedGroupIdentityEnumInstances( KReturnInstance(cr, lagi); lu_ent_free(lue); } /* for */ + if (groups) + g_ptr_array_free(groups, TRUE); CMReturn(CMPI_RC_OK); } diff --git a/src/account/LMI_GroupProvider.c b/src/account/LMI_GroupProvider.c index b147586..1e9c232 100644 --- a/src/account/LMI_GroupProvider.c +++ b/src/account/LMI_GroupProvider.c @@ -200,6 +200,8 @@ static CMPIrc delete_group( } clean: + if (users) + g_value_array_free(users); if (lueg) lu_ent_free(lueg); if (lueu) |