diff --git a/lib/hdb/ndbm.c b/lib/hdb/ndbm.c index fced9d654..a86194cde 100644 --- a/lib/hdb/ndbm.c +++ b/lib/hdb/ndbm.c @@ -333,7 +333,7 @@ krb5_error_code hdb_ndbm_create(krb5_context context, HDB **db, const char *filename) { - *db = malloc(sizeof(**db)); + *db = calloc(1, sizeof(**db)); if (*db == NULL) { krb5_set_error_string(context, "malloc: out of memory"); return ENOMEM;