Eric Pouech eric.pouech@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.