summaryrefslogtreecommitdiff
path: root/source4/kdc
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2016-12-15 17:50:53 +0100
committerStefan Metzmacher <metze@samba.org>2017-01-12 15:35:12 +0100
commitadcb8a91971f12b4a97bca2e5cd88ee23aa15355 (patch)
tree275c118af0748d98c5232287890e070fb2752c1a /source4/kdc
parente467eefb10a1ce80128e3b111a474306a71d696b (diff)
downloadsamba-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/kdc')
-rw-r--r--source4/kdc/mit-kdb/kdb_samba_principals.c4
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;