Memory used by user structure was not initialized. Changed malloc to calloc.
This commit is contained in:
@ -55,8 +55,7 @@ static char *ADMIN_ERR_FILEAPPEND = "Unable to append to password file";
|
||||
static char *ADMIN_ERR_PWDFILEOPEN = "Failed to open password file";
|
||||
static char *ADMIN_ERR_TMPFILEOPEN = "Failed to open temporary password file";
|
||||
static char *ADMIN_ERR_PWDFILEACCESS = "Failed to access password file";
|
||||
static char *ADMIN_ERR_DELLASTUSER = "Deleting user failed, deleting the "
|
||||
"last user is forbidden";
|
||||
static char *ADMIN_ERR_DELLASTUSER = "Deleting the last user is forbidden";
|
||||
static char *ADMIN_SUCCESS = NULL;
|
||||
|
||||
static const int LINELEN=80;
|
||||
|
||||
@ -55,7 +55,7 @@ users_alloc()
|
||||
{
|
||||
USERS *rval;
|
||||
|
||||
if ((rval = malloc(sizeof(USERS))) == NULL)
|
||||
if ((rval = calloc(1, sizeof(USERS))) == NULL)
|
||||
return NULL;
|
||||
|
||||
if ((rval->data = hashtable_alloc(52, user_hash, strcmp)) == NULL)
|
||||
|
||||
Reference in New Issue
Block a user