1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s3-passdb: fix memleak in pdb_default_get_trusted_domain().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
Günther Deschner 2015-03-30 12:32:20 +02:00
parent d0db0f01f7
commit 450b7c619f

View File

@ -2298,9 +2298,17 @@ static NTSTATUS pdb_default_get_trusted_domain(struct pdb_methods *methods,
taiob.current.count = 1;
taiob.current.array = &aia;
unix_to_nt_time(&aia.LastUpdateTime, last_set_time);
aia.AuthType = TRUST_AUTH_TYPE_CLEAR;
aia.AuthInfo.clear.password = (uint8_t *) pwd;
aia.AuthInfo.clear.size = strlen(pwd);
aia.AuthInfo.clear.password = (uint8_t *)talloc_memdup(tdom, pwd,
aia.AuthInfo.clear.size);
SAFE_FREE(pwd);
if (aia.AuthInfo.clear.password == NULL) {
talloc_free(tdom);
return NT_STATUS_NO_MEMORY;
}
taiob.previous.count = 0;
taiob.previous.array = NULL;