From: Andrew Bartlett Date: Tue, 28 Aug 2012 23:09:10 +0000 (+1000) Subject: auth/credentials: Avoid double-free in the failure case X-Git-Tag: ldb-1.1.12~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bcc29f9e7317601737858184f5ec6243552e0c0c;p=thirdparty%2Fsamba.git auth/credentials: Avoid double-free in the failure case This pointer is only valid if dbwrap_fetch returned success. Andrew Bartlett --- diff --git a/auth/credentials/credentials_secrets.c b/auth/credentials/credentials_secrets.c index 33042006075..37e825bee90 100644 --- a/auth/credentials/credentials_secrets.c +++ b/auth/credentials/credentials_secrets.c @@ -235,8 +235,8 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cr TALLOC_FREE(keystr_upper); if (NT_STATUS_IS_OK(status) && dbuf.dsize == 4) { secrets_tdb_lct = IVAL(dbuf.dptr,0); + TALLOC_FREE(dbuf.dptr); } - TALLOC_FREE(dbuf.dptr); keystr = talloc_asprintf(cred, "%s/%s", SECRETS_MACHINE_PASSWORD,