Memory used by user structure was not initialized. Changed malloc to calloc.

This commit is contained in:
vraatikka
2013-08-05 18:21:08 +03:00
parent 234b8c40a3
commit 30456115f7
2 changed files with 2 additions and 3 deletions

View File

@ -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;

View File

@ -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)