blob is not release in _libssh2_dh_secret allocate https://github.com/libssh2/libssh2/blob/3ac32253f98a66e7e55f5657bfe259d286e33edc/src/wincng.c#L2563 crtdbg message ``` Detected memory leaks! Dumping objects -> {190} normal block at 0x000001B22B6A3210, 1544 bytes long. Data: <DHPB > 44 48 50 42 00 02 00 00 CB 00 EA CD C1 ED B3 E4 Object dump complete. ``` patch ``` patch --- libssh2/src/wincng.c 2023-03-19 11:55:01.368892072 +0900 +++ work/src/wincng.c 2023-03-19 11:54:23.872315351 +0900 @@ -2651,6 +2651,7 @@ if(agreement) { BCryptDestroySecret(agreement); } + _libssh2_wincng_safe_free(blob, public_blob_len); if(status == STATUS_NOT_SUPPORTED && _libssh2_wincng.hasAlgDHwithKDF == -1) { goto fb; /* fallback to RSA-based implementation */ ```
Activity
vszakats commentedon Mar 19, 2023
Thanks! Incidently, just discovered this yesterday in #846, commit 75cdcee.
wincng.c: fix memory leak in _libssh2_dh_secret()
wincng: fix memory leak in _libssh2_dh_secret()
wincng.c: fix memory leak in _libssh2_dh_secret()
wincng.c: fix memory leak in _libssh2_dh_secret()
wincng: fix memory leak in _libssh2_dh_secret()
wincng.c: fix memory leak in _libssh2_dh_secret()
wincng: fix memory leak in `_libssh2_dh_secret()`
wincng: fix memory leak in `_libssh2_dh_secret()`