Log short_princ instead of uninitialised filter.
authorMichael Wood <esiotrot@gmail.com>
Fri, 20 Jan 2012 06:30:18 +0000 (08:30 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 21 Jan 2012 12:06:35 +0000 (13:06 +0100)
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Jan 21 13:06:35 CET 2012 on sn-devel-104

source4/kdc/db-glue.c

index ae93b75befe8b9fa12fe2835d0549fe9dcffd703..77c84303a526ca31ea9de0c08333238435cc2fd1 100644 (file)
@@ -1363,7 +1363,6 @@ static krb5_error_code samba_kdc_lookup_server(krb5_context context,
 
        } else {
                int lret;
-               char *filter = NULL;
                char *short_princ;
                const char *realm;
                /* server as client principal case, but we must not lookup userPrincipalNames */
@@ -1386,16 +1385,18 @@ static krb5_error_code samba_kdc_lookup_server(krb5_context context,
                                       DSDB_SEARCH_SHOW_EXTENDED_DN | DSDB_SEARCH_NO_GLOBAL_CATALOG,
                                       "(&(objectClass=user)(samAccountName=%s))",
                                       ldb_binary_encode_string(mem_ctx, short_princ));
-               free(short_princ);
                if (lret == LDB_ERR_NO_SUCH_OBJECT) {
-                       DEBUG(3, ("Failed find a entry for %s\n", filter));
+                       DEBUG(3, ("Failed to find an entry for %s\n", short_princ));
+                       free(short_princ);
                        return HDB_ERR_NOENTRY;
                }
                if (lret != LDB_SUCCESS) {
-                       DEBUG(3, ("Failed single search for for %s - %s\n",
-                                 filter, ldb_errstring(kdc_db_ctx->samdb)));
+                       DEBUG(3, ("Failed single search for %s - %s\n",
+                                 short_princ, ldb_errstring(kdc_db_ctx->samdb)));
+                       free(short_princ);
                        return HDB_ERR_NOENTRY;
                }
+               free(short_princ);
        }
 
        return 0;