1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

mit-kdb: Fix NULL pointer check after malloc

This fixes building with GCC 7.1.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12930

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jul 24 18:45:34 CEST 2017 on sn-devel-144
This commit is contained in:
Andreas Schneider 2017-07-24 12:19:27 +02:00 committed by Andreas Schneider
parent 314cf60893
commit 9b64b11c2f

View File

@ -87,7 +87,7 @@ krb5_error_code kdb_samba_dbekd_encrypt_key_data(krb5_context context,
key_data->key_data_kvno = keyver;
key_data->key_data_type[0] = kkey->enctype;
key_data->key_data_contents[0] = malloc(kkey->length);
if (key_data->key_data_contents[0]) {
if (key_data->key_data_contents[0] == NULL) {
return ENOMEM;
}
memcpy(key_data->key_data_contents[0],