diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2013-12-02 15:51:40 +0100 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2013-12-03 13:33:47 +0100 |
commit | da34dc409c8f96d05433f0b3b4574e7a639ee141 (patch) | |
tree | e83ad2504b21befa0f98bf6ec465db1251895905 /src/account | |
parent | 593292b27221d05d2d43485d8ac9d026cca8a7c2 (diff) | |
download | openlmi-providers-da34dc409c8f96d05433f0b3b4574e7a639ee141.tar.gz openlmi-providers-da34dc409c8f96d05433f0b3b4574e7a639ee141.tar.xz openlmi-providers-da34dc409c8f96d05433f0b3b4574e7a639ee141.zip |
account: Initialize NULL the group array to prevent bad memory access
Found by clang analysis:
Error: PW.BRANCH_PAST_INITIALIZATION:
openlmi-providers-0.4.1_75_gf47c906/src/account/LMI_AccountProvider.c:324: branch_past_initialization: transfer of control bypasses initialization of:
openlmi-providers-0.4.1_75_gf47c906/src/account/LMI_AccountProvider.c:324: caretline: ^
openlmi-providers-0.4.1_75_gf47c906/src/account/LMI_AccountProvider.c:324: name_at_decl_position: variable "groups" (declared at line 328)
Diffstat (limited to 'src/account')
-rw-r--r-- | src/account/LMI_AccountProvider.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/account/LMI_AccountProvider.c b/src/account/LMI_AccountProvider.c index 3769424..5ba701c 100644 --- a/src/account/LMI_AccountProvider.c +++ b/src/account/LMI_AccountProvider.c @@ -284,6 +284,7 @@ static CMPIStatus LMI_AccountModifyInstance( struct lu_ent *lue = NULL; struct lu_error *error = NULL; GValue val; + GValueArray *groups = NULL; guint i = 0; long last_change; @@ -325,7 +326,7 @@ static CMPIStatus LMI_AccountModifyInstance( } /* get list of groups and lock them. userlock variable is our stored username */ - GValueArray *groups = lu_groups_enumerate_by_user (luc, userlock, &error); + groups = lu_groups_enumerate_by_user (luc, userlock, &error); if (groups == NULL) { rc = CMPI_RC_ERR_NOT_FOUND; |