[PATCH 01/11] [Kernel32]: ActCtx: added basic structures for
storing assembly information
Alexandre Julliard
julliard at winehq.org
Thu May 10 04:48:45 CDT 2007
Eric Pouech <eric.pouech at wanadoo.fr> writes:
> + if (actctx->num_assemblies == actctx->allocated_assemblies)
> + {
> + if (actctx->allocated_assemblies)
> + {
> + actctx->allocated_assemblies *= 2;
> + actctx->assemblies = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
> + actctx->assemblies,
> + actctx->allocated_assemblies * sizeof(struct assembly));
> + }
> + else
> + {
> + actctx->allocated_assemblies = 1;
> + actctx->assemblies = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct assembly));
> + }
> + }
> + if (!actctx->assemblies) return NULL;
You will corrupt the previous state if the realloc fails. This is
kernel stuff, please try to be rigorous about error handling.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list