Commit 1d438166 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: Fix bug in managing COFF files array.

parent 9d3be00d
......@@ -138,12 +138,18 @@ static void coff_add_symbol(struct CoffFile* coff_file, struct symt* sym)
{
if (coff_file->neps + 1 >= coff_file->neps_alloc)
{
coff_file->neps_alloc *= 2;
coff_file->entries = (coff_file->entries) ?
HeapReAlloc(GetProcessHeap(), 0, coff_file->entries,
coff_file->neps_alloc * sizeof(struct symt*)) :
HeapAlloc(GetProcessHeap(), 0,
coff_file->neps_alloc * sizeof(struct symt*));
if (coff_file->entries)
{
coff_file->neps_alloc *= 2;
coff_file->entries = HeapReAlloc(GetProcessHeap(), 0, coff_file->entries,
coff_file->neps_alloc * sizeof(struct symt*));
}
else
{
coff_file->neps_alloc = 32;
coff_file->entries = HeapAlloc(GetProcessHeap(), 0,
coff_file->neps_alloc * sizeof(struct symt*));
}
}
coff_file->entries[coff_file->neps++] = sym;
}
......
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