From: Paul Gofman gofmanp@gmail.com
The compiler may optimize out the assignment before free and then second free on the bcrypt handle finds magic values in the freed memory. --- dlls/bcrypt/bcrypt_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 72501faf90e..d23a0328c55 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -397,7 +397,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, const WC
static void destroy_object( struct object *obj ) { - obj->magic = 0; + *(volatile int *)&obj->magic = 0; free( obj ); }