s3-krb5: Fix Coverity #762 (REVERSE_INULL).
authorGünther Deschner <gd@samba.org>
Fri, 20 Mar 2009 10:11:04 +0000 (11:11 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 27 Mar 2009 13:15:50 +0000 (14:15 +0100)
Guenther
(cherry picked from commit 97190ae184dff6450b1390c854f7426e2ee3f980)
(cherry picked from commit 0f7757e94bfa35d22a7349d78578685c0dba22d7)

source/libads/kerberos.c

index 56c3af889324d73dd93e94fd8b2f8b3b67ad9917..973647e8cc8ef2deaab1762893873eca4fcdf912 100644 (file)
@@ -541,13 +541,13 @@ char *kerberos_get_default_realm_from_ccache( void )
 
   out:
 
-       if (princ) {
-               krb5_free_principal(ctx, princ);
-       }
-       if (cc) {
-               krb5_cc_close(ctx, cc);
-       }
        if (ctx) {
+               if (princ) {
+                       krb5_free_principal(ctx, princ);
+               }
+               if (cc) {
+                       krb5_cc_close(ctx, cc);
+               }
                krb5_free_context(ctx);
        }