[cairo] Fix some memory leaks + double free

Sylvestre Ledru sylvestre at mozilla.com
Mon May 12 14:32:38 PDT 2014


On 09/05/2014 12:02, Sylvestre Ledru wrote:
> On 09/05/2014 11:55, Uli Schlachter wrote:
>> On 09.05.2014 11:30, Sylvestre Ledru wrote:
>>> diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
>>> index c200c28..17fe1df 100644
>>> --- a/src/cairo-pdf-surface.c
>>> +++ b/src/cairo-pdf-surface.c
>>> @@ -2642,6 +2642,10 @@ _cairo_pdf_surface_lookup_jbig2_global (cairo_pdf_surface_t       *surface,
>>>      }
>>>  
>>>      global.id = malloc(global_id_length);
>>> +    if (unlikely (global.id == NULL)) {
>>> +	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
>>> +    }
>>> +
>>>      memcpy (global.id, global_id, global_id_length);
>>>      global.id_length = global_id_length;
>>>      global.res = _cairo_pdf_surface_new_object (surface);
>> Thanks, this is what I meant!
>>
>> However, to fix your warnings from clang-analyze, don't you still need your
>> original change, too?
>>
> Of course, sorry! Updated!
>
>
Uli, could you checkin the patch? I don't have permissions.
Thanks,
Sylvestre


More information about the cairo mailing list