From: Eric Pouech <epouech(a)codeweavers.com> gcc tends to optimize away the magic field cleanup, leading to believe the query is still allocated. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/pdh/pdh_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c index 073a74e1b52..a63c18e0bb4 100644 --- a/dlls/pdh/pdh_main.c +++ b/dlls/pdh/pdh_main.c @@ -97,7 +97,7 @@ static struct counter *create_counter( void ) static void destroy_counter( struct counter *counter ) { - counter->magic = 0; + SecureZeroMemory( &counter->magic, sizeof( counter->magic ) ); free( counter->path ); free( counter ); } @@ -130,7 +130,7 @@ static struct query *create_query( void ) static void destroy_query( struct query *query ) { - query->magic = 0; + SecureZeroMemory( &query->magic, sizeof( query->magic ) ); free( query ); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4323