Only attempt to close RNG file descriptor on platforms with XCLOSE.

This commit is contained in:
Kareem
2024-11-15 11:27:26 -07:00
parent fb880e943b
commit 2e83b97909

View File

@@ -1377,9 +1377,9 @@ int wc_FreeRng(WC_RNG* rng)
ret = WC_HW_E;
#endif
#ifndef USE_WINDOWS_API
#ifdef XCLOSE
if(rng->seed.fd != 0 && rng->seed.fd != -1) {
close(rng->seed.fd);
XCLOSE(rng->seed.fd);
rng->seed.fd = -1;
}
#endif