summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-01-05 17:24:17 +0100
committerMichael Adam <obnox@samba.org>2010-01-07 11:07:51 +0100
commit2fad148b271fe8623299af551d3ae103d85c5d5f (patch)
tree91928df9e6f0d2b0a528c03cee63e4bb3e76cd50 /source3/passdb
parent71e3de6c9fa50ce0035092da6b1a27017ee1bb56 (diff)
downloadsamba-2fad148b271fe8623299af551d3ae103d85c5d5f.tar.gz
samba-2fad148b271fe8623299af551d3ae103d85c5d5f.tar.bz2
samba-2fad148b271fe8623299af551d3ae103d85c5d5f.zip
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
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_get_set.c1
1 files changed, 1 insertions, 0 deletions
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) {