Bug 91537

Summary: Memory leak in cairo-gl-operand.c
Product: cairo Reporter: Sahil Vij <sahil.vij>
Component: gl backendAssignee: Sahil Vij <sahil.vij>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Sahil Vij 2015-08-03 10:37:25 UTC
http://cgit.freedesktop.org/cairo/tree/src/cairo-gl-operand.c , At line 303 and 312

At _cairo_gl_pattern_texture_setup() API

If _cairo_gl_context_release (ctx, status) (line 303) and
 _cairo_gl_context_acquire (dst->base.device, &ctx) (line 312) 
do not return non-zero status, 

Then jump is made to "goto fail" (line 305 and 314 respectively) and the memory allocated to "image" is not freed which is a memory leak.
Comment 1 Sahil Vij 2015-08-03 11:27:35 UTC
The patch for this Bug is submitted.
and the link for the patch is as follows:

http://lists.freedesktop.org/archives/cairo/2015-August/026432.html
Comment 2 Bryce Harrington 2015-10-15 20:17:44 UTC
commit f6c46d9473e40d4a3363c96e1fc7fffc81ed12e7
Author:     Sahil Vij <sahil.vij@samsung.com>
AuthorDate: Fri Aug 7 18:01:18 2015 -0700
Commit:     Bryce Harrington <bryce@osg.samsung.com>
CommitDate: Fri Aug 7 18:02:07 2015 -0700

    gl: Fix bug in _cairo_gl_pattern_texture_setup()
    
    The memory allocated to "image" at line 298 is not freed before moving to label fail at line 305 and 314.
    This patch takes care of this memory leak in above mentioned cases.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91537
    Signed-off-by: Sahil Vij <sahil.vij@samsung.com>
    Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.