(hdb_ndbm_create): use calloc to allocate memory

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16303 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-11-28 23:31:36 +00:00
parent 8ce2056373
commit daf7286660

View File

@@ -333,7 +333,7 @@ krb5_error_code
hdb_ndbm_create(krb5_context context, HDB **db, hdb_ndbm_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;