(hdb_db_create): use calloc to callocate memory

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16304 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-11-28 23:33:24 +00:00
parent daf7286660
commit 0fa794702c
2 changed files with 2 additions and 2 deletions

View File

@@ -270,7 +270,7 @@ krb5_error_code
hdb_db_create(krb5_context context, HDB **db, hdb_db_create(krb5_context context, HDB **db,
const char *filename) const char *filename)
{ {
*db = malloc(sizeof(**db)); *db = calloc(1, sizeof(**db));
if (*db == NULL) { if (*db == NULL) {
krb5_set_error_string(context, "malloc: out of memory"); krb5_set_error_string(context, "malloc: out of memory");
return ENOMEM; return ENOMEM;

View File

@@ -318,7 +318,7 @@ krb5_error_code
hdb_db_create(krb5_context context, HDB **db, hdb_db_create(krb5_context context, HDB **db,
const char *filename) const char *filename)
{ {
*db = malloc(sizeof(**db)); *db = calloc(1, sizeof(**db));
if (*db == NULL) { if (*db == NULL) {
krb5_set_error_string(context, "malloc: out of memory"); krb5_set_error_string(context, "malloc: out of memory");
return ENOMEM; return ENOMEM;