Commit 00e1e5dd authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Fix memory leak in GdipSetStringFormatMeasurableCharacterRanges.

parent ffc4a49b
......@@ -252,15 +252,19 @@ GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat *format,
GpStatus WINGDIPAPI GdipSetStringFormatMeasurableCharacterRanges(
GpStringFormat *format, INT rangeCount, GDIPCONST CharacterRange *ranges)
{
CharacterRange *new_ranges;
if (!(format && ranges))
return InvalidParameter;
TRACE("%p, %d, %p\n", format, rangeCount, ranges);
format->character_ranges = GdipAlloc(rangeCount * sizeof(CharacterRange));
if (!format->character_ranges)
new_ranges = GdipAlloc(rangeCount * sizeof(CharacterRange));
if (!new_ranges)
return OutOfMemory;
GdipFree(format->character_ranges);
format->character_ranges = new_ranges;
memcpy(format->character_ranges, ranges, sizeof(CharacterRange) * rangeCount);
format->range_count = rangeCount;
......
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