diff options
author | Andreas Schneider <asn@samba.org> | 2016-12-15 17:50:53 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-01-12 15:35:12 +0100 |
commit | adcb8a91971f12b4a97bca2e5cd88ee23aa15355 (patch) | |
tree | 275c118af0748d98c5232287890e070fb2752c1a /source4 | |
parent | e467eefb10a1ce80128e3b111a474306a71d696b (diff) | |
download | samba-adcb8a91971f12b4a97bca2e5cd88ee23aa15355.tar.gz |
mit-kdb: Use calloc() to allocate memory
This avoids a memset().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/kdc/mit-kdb/kdb_samba_principals.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source4/kdc/mit-kdb/kdb_samba_principals.c b/source4/kdc/mit-kdb/kdb_samba_principals.c index dc24e7e3cbe..a777df840a2 100644 --- a/source4/kdc/mit-kdb/kdb_samba_principals.c +++ b/source4/kdc/mit-kdb/kdb_samba_principals.c @@ -78,13 +78,11 @@ static krb5_error_code ks_get_master_key_principal(krb5_context context, *kentry_ptr = NULL; - kentry = malloc(sizeof(krb5_db_entry)); + kentry = calloc(1, sizeof(krb5_db_entry)); if (kentry == NULL) { return ENOMEM; } - ZERO_STRUCTP(kentry); - kentry->magic = KRB5_KDB_MAGIC_NUMBER; kentry->len = KRB5_KDB_V1_BASE_LENGTH; kentry->attributes = KRB5_KDB_DISALLOW_ALL_TIX; |