RESOLVED FIXED 25928
[Gtk] Several errors detected by cppcheck
https://bugs.webkit.org/show_bug.cgi?id=25928
Summary [Gtk] Several errors detected by cppcheck
xxx
Reported 2009-05-21 06:47:31 PDT
cppcheck (http://cppcheck.wiki.sourceforge.net/) is greater for checking c++ code! [./accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:63]: (all) Memory leak: fallbackCache [./css/CSSParser.cpp:370]: (all) Memory leak: prop [./css/CSSPrimitiveValue.cpp:79]: (all) Memory leak: colorValueCache [./page/DOMWindow.cpp:610]: (all) Memory leak: timer [./platform/graphics/chromium/FontCacheChromiumWin.cpp:231]: (all) Memory leak: fontNameMap [./platform/graphics/chromium/FontCacheChromiumWin.cpp:294]: (all) Memory leak: fontCmapCache [./platform/graphics/opentype/OpenTypeUtilities.cpp:375]: (all) Buffer overrun [./platform/graphics/opentype/OpenTypeUtilities.cpp:384]: (all) Array index out of bounds [./platform/graphics/opentype/OpenTypeUtilities.cpp:385]: (all) Array index out of bounds [./platform/graphics/opentype/OpenTypeUtilities.cpp:386]: (all) Array index out of bounds [./platform/graphics/opentype/OpenTypeUtilities.cpp:387]: (all) Array index out of bounds [./platform/qt/FileSystemQt.cpp:126]: (all) Memory leak: temp [./platform/qt/PasteboardQt.cpp:77]: (all) Memory leak: md [./rendering/style/SVGRenderStyle.cpp:55]: (all) Memory leak: defaultStyle
Attachments
Fix for cross-platform (1.88 KB, patch)
2009-05-22 07:47 PDT, Alexey Proskuryakov
no flags
Alexey Proskuryakov
Comment 1 2009-05-22 07:31:58 PDT
Some of these warnings are false alarms, but some are real.
Alexey Proskuryakov
Comment 2 2009-05-22 07:47:07 PDT
Created attachment 30581 [details] Fix for cross-platform This patch fixes all issues affecting cross-platform code (there was only one). Some platform issues look real, too, but I didn't feel qualified to fix them. > [./css/CSSParser.cpp:370]: (all) Memory leak: prop Fixed. > [./css/CSSPrimitiveValue.cpp:79]: (all) Memory leak: colorValueCache > [./page/DOMWindow.cpp:610]: (all) Memory leak: timer > [./rendering/style/SVGRenderStyle.cpp:55]: (all) Memory leak: defaultStyle These are false alarms.
Eric Seidel (no email)
Comment 3 2009-05-22 07:57:27 PDT
Comment on attachment 30581 [details] Fix for cross-platform I think the ChangeLog could be slightly clearer. To state that specifically we would leak if we ever parsed UINT_MAX / sizeof(CSSProperty*) properties (aka ~ 1billion). Looks great though.
Alexey Proskuryakov
Comment 4 2009-05-22 08:06:23 PDT
Comment on attachment 30581 [details] Fix for cross-platform Committed r44044, clearing review flag.
Alexey Proskuryakov
Comment 5 2009-05-22 08:08:03 PDT
FontCacheChromiumWin.cpp ones are also false alarms, so these are ones to be investigated by port maintainers: [./accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:63]: (all) Memory leak: fallbackCache [./platform/graphics/opentype/OpenTypeUtilities.cpp:375]: (all) Buffer overrun [./platform/graphics/opentype/OpenTypeUtilities.cpp:384]: (all) Array index out of bounds [./platform/graphics/opentype/OpenTypeUtilities.cpp:385]: (all) Array index out of bounds [./platform/graphics/opentype/OpenTypeUtilities.cpp:386]: (all) Array index out of bounds [./platform/graphics/opentype/OpenTypeUtilities.cpp:387]: (all) Array index out of bounds [./platform/qt/FileSystemQt.cpp:126]: (all) Memory leak: temp [./platform/qt/PasteboardQt.cpp:77]: (all) Memory leak: md
Gustavo Noronha (kov)
Comment 6 2009-06-16 15:21:48 PDT
(In reply to comment #0) > [./accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:63]: (all) Memory leak: > fallbackCache My reading of the code indicates this is a false-positive. fallbackCache is meant to be alive from the first call onwards (it's static).
Andreas Kling
Comment 7 2010-03-16 05:18:58 PDT
(In reply to comment #5) > [./platform/qt/PasteboardQt.cpp:77]: (all) Memory leak: md False positive - ownership is transferred in QClipboard::setMimeData()
Andreas Kling
Comment 8 2010-03-17 04:03:11 PDT
Actually, this is also a false positive: [./platform/qt/FileSystemQt.cpp:126]: (all) Memory leak: temp Removing Qt keyword.
Gustavo Noronha (kov)
Comment 9 2010-03-17 07:08:04 PDT
I think we can close this bug, then, since the only GTK+ one was also a false-positive. Thanks!
Note You need to log in before you can comment on or make changes to this bug.