gcc tends to optimize away the magic field cleanup, leading to believe the query is still allocated.
Signed-off-by: Eric Pouech epouech@codeweavers.com
From: Eric Pouech epouech@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@codeweavers.com --- dlls/pdh/pdh_main.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c index 073a74e1b52..e37277b3718 100644 --- a/dlls/pdh/pdh_main.c +++ b/dlls/pdh/pdh_main.c @@ -98,6 +98,7 @@ static struct counter *create_counter( void ) static void destroy_counter( struct counter *counter ) { counter->magic = 0; + MemoryBarrier(); free( counter->path ); free( counter ); } @@ -131,6 +132,7 @@ static struct query *create_query( void ) static void destroy_query( struct query *query ) { query->magic = 0; + MemoryBarrier(); free( query ); }
We use [Rtl]SecureZeroMemory() elsewhere.