[cairo-bugs] [Bug 19206] New: perf/cairo-perf-graph-files.c:322: Mismatching allocation and deallocation: id

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Dec 20 10:51:22 PST 2008


http://bugs.freedesktop.org/show_bug.cgi?id=19206

           Summary: perf/cairo-perf-graph-files.c:322: Mismatching
                    allocation and deallocation: id
           Product: cairo
           Version: 1.9.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
        AssignedTo: cworth at cworth.org
        ReportedBy: dvice_null at yahoo.com
         QAContact: cairo-bugs at cairographics.org


I found this from latest git version.

In file perf/cairo-perf-graph-files.c:322: 
Variable id is allocated with:
char *id = g_malloc (len + 1);

And later released:
free (id);

"It's important to match g_malloc() with g_free(), plain malloc() with free(),
and (if you're using C++) new with delete and new[] with delete[]. Otherwise
bad things can happen, since these allocators may use different memory pools
(and new/delete call constructors and destructors)."
http://library.gnome.org/devel/glib/stable/glib-Memory-Allocation.html

ps. The version drop down list does not have "git" or similar option for bugs
found from the very latest source files. 

This bug was found using cppcheck: http://cppcheck.wiki.sourceforge.net/


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the cairo-bugs mailing list