(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:
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user