mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 08:54:05 +00:00
hhctrl: Handle memory allocation failure in GetChmString.
This commit is contained in:
parent
73bbada784
commit
f41214edaa
|
@ -32,18 +32,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp);
|
|||
static LPCSTR GetChmString(CHMInfo *chm, DWORD offset)
|
||||
{
|
||||
LPCSTR str;
|
||||
char **new_strings;
|
||||
|
||||
if(!chm->strings_stream)
|
||||
return NULL;
|
||||
|
||||
if(chm->strings_size <= (offset >> BLOCK_BITS)) {
|
||||
chm->strings_size = (offset >> BLOCK_BITS)+1;
|
||||
if(chm->strings)
|
||||
chm->strings = heap_realloc_zero(chm->strings,
|
||||
if(chm->strings) {
|
||||
new_strings = heap_realloc_zero(chm->strings,
|
||||
chm->strings_size*sizeof(char*));
|
||||
else
|
||||
if(!new_strings)
|
||||
return NULL;
|
||||
chm->strings = new_strings;
|
||||
}else {
|
||||
chm->strings = heap_alloc_zero(
|
||||
chm->strings_size*sizeof(char*));
|
||||
if(!chm->strings)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue