Commit 0b09db59 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

comctl32: Fix memory leak on error path in EDIT_MakeUndoFit.

parent faae2144
...@@ -1292,6 +1292,7 @@ static BOOL EDIT_MakeFit(EDITSTATE *es, UINT size) ...@@ -1292,6 +1292,7 @@ static BOOL EDIT_MakeFit(EDITSTATE *es, UINT size)
static BOOL EDIT_MakeUndoFit(EDITSTATE *es, UINT size) static BOOL EDIT_MakeUndoFit(EDITSTATE *es, UINT size)
{ {
UINT alloc_size; UINT alloc_size;
WCHAR *new_undo_text;
if (size <= es->undo_buffer_size) if (size <= es->undo_buffer_size)
return TRUE; return TRUE;
...@@ -1299,7 +1300,8 @@ static BOOL EDIT_MakeUndoFit(EDITSTATE *es, UINT size) ...@@ -1299,7 +1300,8 @@ static BOOL EDIT_MakeUndoFit(EDITSTATE *es, UINT size)
TRACE("trying to ReAlloc to %d+1\n", size); TRACE("trying to ReAlloc to %d+1\n", size);
alloc_size = ROUND_TO_GROW((size + 1) * sizeof(WCHAR)); alloc_size = ROUND_TO_GROW((size + 1) * sizeof(WCHAR));
if ((es->undo_text = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, es->undo_text, alloc_size))) { if ((new_undo_text = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, es->undo_text, alloc_size))) {
es->undo_text = new_undo_text;
es->undo_buffer_size = alloc_size/sizeof(WCHAR) - 1; es->undo_buffer_size = alloc_size/sizeof(WCHAR) - 1;
return TRUE; return TRUE;
} }
......
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