Commit 91ed2a81 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

riched20: Fix a memory leak on error path (Coverity).

parent 8dd3f7d8
......@@ -1268,12 +1268,10 @@ static void ME_RTFReadShpPictGroup( RTF_Info *info )
static DWORD read_hex_data( RTF_Info *info, BYTE **out )
{
DWORD read = 0, size = 1024;
BYTE *buf = HeapAlloc( GetProcessHeap(), 0, size );
BYTE val;
BYTE *buf, val;
BOOL flip;
*out = NULL;
if (!buf) return 0;
if (info->rtfClass != rtfText)
{
......@@ -1281,6 +1279,9 @@ static DWORD read_hex_data( RTF_Info *info, BYTE **out )
return 0;
}
buf = HeapAlloc( GetProcessHeap(), 0, size );
if (!buf) return 0;
val = info->rtfMajor;
for (flip = TRUE;; flip = !flip)
{
......
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