diff options
-rw-r--r-- | source3/passdb/secrets.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index ee7c441fcf..04d6da2814 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -1044,8 +1044,6 @@ BOOL secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx, return False; } - tdb_close(tdb_sc); - pdc = TALLOC_ZERO_P(mem_ctx, struct dcinfo); /* Retrieve the record. */ @@ -1063,6 +1061,7 @@ BOOL secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx, if (ret == -1 || l1 != 8 || l2 != 8 || l3 != 8 || l4 != 16 || l5 != 16) { /* Bad record - delete it. */ tdb_delete_bystring(tdb_sc, keystr); + tdb_close(tdb_sc); TALLOC_FREE(keystr); TALLOC_FREE(pdc); SAFE_FREE(pseed_chal); @@ -1074,6 +1073,8 @@ BOOL secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx, return False; } + tdb_close(tdb_sc); + memcpy(pdc->seed_chal.data, pseed_chal, 8); memcpy(pdc->clnt_chal.data, pclnt_chal, 8); memcpy(pdc->srv_chal.data, psrv_chal, 8); |