mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Fix wrong return value check of mmap function
The mmap function never returns NULL. If an error occurs, the function returns MAP_FAILED. CLA: trivial Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12187)
This commit is contained in:
parent
3fd16304f4
commit
1d78129dd2
@ -514,7 +514,7 @@ static void sh_done(void)
|
||||
OPENSSL_free(sh.freelist);
|
||||
OPENSSL_free(sh.bittable);
|
||||
OPENSSL_free(sh.bitmalloc);
|
||||
if (sh.map_result != NULL && sh.map_size)
|
||||
if (sh.map_result != MAP_FAILED && sh.map_size)
|
||||
munmap(sh.map_result, sh.map_size);
|
||||
memset(&sh, 0, sizeof(sh));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user