mit-kdb: Fix NULL pointer check after malloc
authorAndreas Schneider <asn@samba.org>
Mon, 24 Jul 2017 10:19:27 +0000 (12:19 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 24 Jul 2017 16:45:33 +0000 (18:45 +0200)
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

source4/kdc/mit-kdb/kdb_samba_pac.c

index 0ab8c372e0e9fe505a47b3845955d34dbc6057a9..15497603b108cfbd76a858617c9d484289a15b55 100644 (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],