lib: Fix CID 1356315 Dereference before null check
authorVolker Lendecke <vl@samba.org>
Tue, 15 Mar 2016 19:48:19 +0000 (20:48 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Mar 2016 23:29:14 +0000 (00:29 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/krb5_wrap/krb5_samba.c

index 9ee71f5..247b83b 100644 (file)
@@ -1628,12 +1628,9 @@ out:
        if (memcmp(&zero_kt_entry, &kt_entry, sizeof(krb5_keytab_entry))) {
                smb_krb5_kt_free_entry(context, &kt_entry);
        }
-       if (keytab) {
-               if (memcmp(&cursor, &zero_csr, sizeof(krb5_kt_cursor)) != 0) {
-                       krb5_kt_end_seq_get(context, keytab, &cursor);
-               }
+       if (memcmp(&cursor, &zero_csr, sizeof(krb5_kt_cursor)) != 0) {
+               krb5_kt_end_seq_get(context, keytab, &cursor);
        }
-
        return ret;
 }