From: Shaun Ren sren@codeweavers.com
Signed-off-by: Shaun Ren sren@codeweavers.com --- dlls/webservices/error.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/webservices/error.c b/dlls/webservices/error.c index d5364e42bff..ad49b7e085b 100644 --- a/dlls/webservices/error.c +++ b/dlls/webservices/error.c @@ -41,6 +41,7 @@ struct error { ULONG magic; CRITICAL_SECTION cs; + WS_HEAP *heap; ULONG prop_count; struct prop prop[ARRAY_SIZE( error_props )]; }; @@ -54,6 +55,11 @@ static struct error *alloc_error(void) ULONG size = sizeof(*ret) + prop_size( error_props, count );
if (!(ret = calloc( 1, size ))) return NULL; + if (WsCreateHeap( 1 << 20, 0, NULL, 0, &ret->heap, NULL ) != S_OK) + { + free( ret ); + return NULL; + }
ret->magic = ERROR_MAGIC; InitializeCriticalSection( &ret->cs ); @@ -66,6 +72,7 @@ static struct error *alloc_error(void)
static void free_error( struct error *error ) { + WsFreeHeap( error->heap ); error->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &error->cs ); free( error ); @@ -113,6 +120,7 @@ static void reset_error( struct error *error ) ULONG code = 0; /* FIXME: release strings added with WsAddErrorString when it's implemented, reset string count */ prop_set( error->prop, error->prop_count, WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE, &code, sizeof(code) ); + WsResetHeap( error->heap, NULL ); }
/**************************************************************************