From 2fad148b271fe8623299af551d3ae103d85c5d5f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 5 Jan 2010 17:24:17 +0100 Subject: s3:pdb_set_pw_history: free the old history before setting the new. This is not strictly necessary, since this only leaks into the struct samu, and this is not so long-lived in the code path that changes the password, but it definitely correct and does not harm. Michael --- source3/passdb/pdb_get_set.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/passdb/pdb_get_set.c') diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 30775e49fe..da65440b06 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -876,6 +876,7 @@ bool pdb_set_lanman_passwd(struct samu *sampass, const uint8 pwd[LM_HASH_LEN], e bool pdb_set_pw_history(struct samu *sampass, const uint8 *pwd, uint32 historyLen, enum pdb_value_state flag) { if (historyLen && pwd){ + data_blob_free(&(sampass->nt_pw_his)); sampass->nt_pw_his = data_blob_talloc(sampass, pwd, historyLen*PW_HISTORY_ENTRY_LEN); if (!sampass->nt_pw_his.length) { -- cgit