summaryrefslogtreecommitdiffstats
path: root/ldap/synctools/passwordsync/passhand.cpp
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2006-03-22 18:53:37 +0000
committerNathan Kinder <nkinder@redhat.com>2006-03-22 18:53:37 +0000
commitb7acb4812ac3dbf02c1cfb9d52ade8ef7b85869a (patch)
tree7e30dcb37fb4e863408568a196a5a30de5d90ee3 /ldap/synctools/passwordsync/passhand.cpp
parent9996baa53607cee533b07af245e8f9e8ffea76ef (diff)
186171 - Fixed memory leaks in passhook.dll
Diffstat (limited to 'ldap/synctools/passwordsync/passhand.cpp')
-rw-r--r--ldap/synctools/passwordsync/passhand.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/ldap/synctools/passwordsync/passhand.cpp b/ldap/synctools/passwordsync/passhand.cpp
index 7d5af3cd..ddad1977 100644
--- a/ldap/synctools/passwordsync/passhand.cpp
+++ b/ldap/synctools/passwordsync/passhand.cpp
@@ -200,11 +200,17 @@ exit:
int clearSet(PASS_INFO_LIST* passInfoList)
{
- // ToDo: zero out memory
+ while (!passInfoList->empty()) {
+ PASS_INFO& pi = passInfoList->back();
+ SecureZeroMemory(pi.password, strlen(pi.password));
+ free(pi.password);
+ free(pi.username);
+ passInfoList->pop_back();
+ }
passInfoList->clear();
- return -1;
+ return 0;
}
int encrypt(char* plainTextBuf, int plainTextLen, char* cipherTextBuf, int cipherTextLen, int* resultTextLen)