From 8fa2907efd694a40f7bceb7a95e8acfe84e71000 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 13 Jun 2006 18:01:58 +0000 Subject: r16197: Fix Klocwork id 1338 (This used to be commit 963ae5bd144b90e71331a88029698a1a6dc52190) --- source3/passdb/secrets.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3') 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); -- cgit