1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-20 02:42:09 +03:00

wincng: fix memory leak in _libssh2_dh_secret()

Patch-by: iruis on github
Assisted-by: Marc Hörsken
Bug #846, commit e3487092ef9553af67633c6747cb9ab2f86465e0.
Fixes #856
Closes #858
This commit is contained in:
Viktor Szakats
2023-03-20 00:35:15 +00:00
parent 244a1ae856
commit 5a9944e754

View File

@@ -2651,6 +2651,9 @@ out:
if(agreement) {
BCryptDestroySecret(agreement);
}
free(blob);
if(status == STATUS_NOT_SUPPORTED &&
_libssh2_wincng.hasAlgDHwithKDF == -1) {
goto fb; /* fallback to RSA-based implementation */