summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Rakus <rrakus@redhat.com>2013-07-01 11:48:48 +0200
committerRoman Rakus <rrakus@redhat.com>2013-07-03 09:54:47 +0200
commit07d7a7b16b4a0308876b3a3a1e67c0ab7e40fa2b (patch)
tree6bb6c44bebdf2f4c6eb3c2ec8906478af12d15ad
parent21429a3651ae38fcd7beb5d48c4b6115d1359e16 (diff)
downloadopenlmi-providers-07d7a7b16b4a0308876b3a3a1e67c0ab7e40fa2b.tar.gz
openlmi-providers-07d7a7b16b4a0308876b3a3a1e67c0ab7e40fa2b.tar.xz
openlmi-providers-07d7a7b16b4a0308876b3a3a1e67c0ab7e40fa2b.zip
Account: Use strdup instead of malloc-strcpy combo
Signed-off-by: Roman Rakus <rrakus@redhat.com>
-rw-r--r--src/account/LMI_AccountManagementServiceProvider.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/account/LMI_AccountManagementServiceProvider.c b/src/account/LMI_AccountManagementServiceProvider.c
index 22c3663..b01f5a3 100644
--- a/src/account/LMI_AccountManagementServiceProvider.c
+++ b/src/account/LMI_AccountManagementServiceProvider.c
@@ -436,14 +436,12 @@ KUint32 LMI_AccountManagementService_CreateAccount(
DontCreateGroup->value)
{
/* add user to "users" group */
- group_name = malloc((strlen("users")+1) * sizeof(char));
- strcpy(group_name, "users");
+ group_name = strdup("users");
}
else
{
/* add user to the group with same name as user name */
- group_name = malloc((strlen(Name->chars)+1) * sizeof(char));
- strcpy(group_name, Name->chars);
+ group_name = strdup(Name->chars);
}
if (lu_group_lookup_name(luc, group_name, lue_group, &error))
{