Re: Fix some memory leaks + double free

Sylvestre Ledru <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
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
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.