Bug 91537 - Memory leak in cairo-gl-operand.c
Summary: Memory leak in cairo-gl-operand.c
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: gl backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Sahil Vij
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-03 10:37 UTC by Sahil Vij
Modified: 2015-10-15 20:17 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.