From 16906287ddf54c76137f6a536743e1f6abb04038 Mon Sep 17 00:00:00 2001 From: Roman Rakus Date: Wed, 10 Oct 2012 16:26:11 +0200 Subject: Account: Minor change in create account method Signed-off-by: Roman Rakus --- src/account/LMI_AccountManagementServiceProvider.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/account/LMI_AccountManagementServiceProvider.c b/src/account/LMI_AccountManagementServiceProvider.c index dd91d1c..ff09653 100644 --- a/src/account/LMI_AccountManagementServiceProvider.c +++ b/src/account/LMI_AccountManagementServiceProvider.c @@ -319,18 +319,15 @@ KUint32 LMI_AccountManagementService_CreateAccount( CMPIStatus* status) { /* TODO - Use embedded instance? */ -/* TODO - convert errmsg to array and don't use malloc/free */ /* TODO - password creation */ /* XXX - split to functions and/or macros */ - char *errmsg = NULL; + char errmsg[256]; #define FAIL(MSG, ERROR, STATUS, RETVAL)\ - errmsg = malloc(256 * sizeof(char));\ snprintf(errmsg, 256, (MSG), (ERROR));\ KSetStatus2(cb, status, STATUS, errmsg);\ KUint32_Set(&result, (RETVAL));\ - free(errmsg); KUint32 result = KUINT32_INIT; struct lu_context *luc = NULL; @@ -508,7 +505,6 @@ KUint32 LMI_AccountManagementService_CreateAccount( FAIL("Error setting ownership of homedir: %s\n", strerror(errno), ERR_FAILED, 3); goto clean; - errmsg = malloc(256 * sizeof(char)); } } -- cgit