Commit 68edddc9 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

pdh: Zero out magic fields with SecureZeroMemory().

gcc tends to optimize away the magic field cleanup, leading to believe the query is still allocated. Signed-off-by: 's avatarEric Pouech <epouech@codeweavers.com>
parent b3e0271b
...@@ -97,7 +97,8 @@ static struct counter *create_counter( void ) ...@@ -97,7 +97,8 @@ static struct counter *create_counter( void )
static void destroy_counter( struct counter *counter ) static void destroy_counter( struct counter *counter )
{ {
counter->magic = 0; /* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory( &counter->magic, sizeof( counter->magic ) );
free( counter->path ); free( counter->path );
free( counter ); free( counter );
} }
...@@ -130,7 +131,8 @@ static struct query *create_query( void ) ...@@ -130,7 +131,8 @@ static struct query *create_query( void )
static void destroy_query( struct query *query ) static void destroy_query( struct query *query )
{ {
query->magic = 0; /* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory( &query->magic, sizeof( query->magic ) );
free( query ); free( query );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment