[cairo-bugs] [Bug 19207] New: perf/cairo-perf-report.c:455: Memory leak: baseName

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Dec 20 10:59:19 PST 2008


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

           Summary: perf/cairo-perf-report.c:455: Memory leak: baseName
           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


This was found from the latest git version.

In file perf/cairo-perf-report.c:455: 
Variable baseName allocates memory with strdup but never releases it. Is the
strdup() and the whole variable even necessary here?

    char *baseName;

    configuration = xmalloc (strlen (filename) * sizeof (char) + 1);
    strcpy (configuration, filename);
    baseName = strdup (basename (configuration));
    report->configuration = xmalloc (strlen (filename) * sizeof (char) + 1);
    strcpy(report->configuration, baseName);

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