Commit Graph

261 Commits

Author SHA1 Message Date
PKEuS 6b6f780057 code cleanups and refactorings 2011-11-26 21:02:04 +01:00
Daniel Marjamäki 50c320ef27 memory leaks: Made leak checking inconclusive instead of experimental 2011-11-25 14:47:45 +01:00
Daniel Marjamäki 345220b36f removed unused include 2011-11-22 19:54:15 +01:00
Edoardo Prezioso a32b05197d Change every 'tokAt(1)' to 'next()' and every 'tokAt(-1)' to 'previous()'.
Added a safety check to ensure that a 'previous()' call doesn't crash (not sure if it's needed or not).
2011-11-20 15:59:37 +01:00
Edoardo Prezioso 11dd3c09ce Change every 'tokAt(1)->' to 'next()->' because 'tokAt(1) == 0' is equivalent to 'next() == 0', hence the equivalent cppcheck crash. 2011-11-20 15:09:57 +01:00
Edoardo Prezioso 42e369a4b4 Change every 'tokAt(..)->link()' to 'linkAt(..)'. 2011-11-20 14:24:27 +01:00
Daniel Marjamäki 690702a742 Memory leaks: Made CheckMemoryLeakInFunction experimental 2011-11-20 14:11:22 +01:00
Edoardo Prezioso 2c64d299ca Change every 'tokAt(...)->str()' to 'strAt(...)'. 2011-11-13 13:10:59 +01:00
Daniel Marjamäki 688e290332 Memory leaks: Fixed false positive for 'char *p = strcpy(malloc(10),str);' 2011-11-11 09:07:02 +01:00
Marek Zmysłowski fed875f4a4 Fix #70 (Locate memory leaks when alloc happens in function parameter)
http://sourceforge.net/apps/trac/cppcheck/ticket/70
2011-11-07 23:50:57 +02:00
Thomas Jarosch 434fb933a8 Implement Token::findsimplematch und use it for simple patterns 2011-10-27 15:59:22 +02:00
Thomas Jarosch 54adb910ec Use Token::simpleMatch instead of Token::Match for simple patterns 2011-10-27 15:59:22 +02:00
Thomas Jarosch 6047a28902 Fixed #3185 (Add three more exit functions) 2011-10-23 12:23:53 +02:00
Jonathan Neuschäfer 4fb7865f49 fix typos using codespell
Codespell is available at http://git.profusion.mobi/cgit.cgi/lucas/codespell/.
2011-10-13 22:04:41 +02:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Marek Zmysłowski 07d8cd0a12 improved realloc checking '*p = realloc(*p,..'. Ticket: #1791 2011-10-11 22:07:14 +02:00
Daniel Marjamäki 84f190abf7 Fixed #3096 (false negative: memory leak not found when passing string to strtok) 2011-09-09 07:25:47 +02:00
Daniel Marjamäki 184e0550b8 updated comments 2011-09-08 18:23:25 +02:00
Robert Reif acebc635b5 add support for deallocating memory with realloc 2011-08-30 23:42:11 -04:00
Daniel Marjamäki a1aa66f370 Fixed #3039 (False Positive: Memory Leak 'p = pop(p);') 2011-08-28 11:28:14 +02:00
Daniel Marjamäki 15e965b530 Fixed #3038 (False Positive - memory leak (struct member passed to subfunction)) 2011-08-26 19:26:21 +02:00
Daniel Marjamäki 6d9463139d Fixed #3038 (False Positive - memory leak) 2011-08-25 19:59:44 +02:00
Daniel Marjamäki 2f0fc9444f Fixed #3041 (false positive reported for error with id='deallocuse') 2011-08-23 23:18:47 +02:00
Daniel Marjamäki dd09b24208 Fixed #3024 (False positive: memory leak for 'rc.bitmap' when rc is added to linux kernel list) 2011-08-20 09:17:34 +02:00
Daniel Marjamäki 5f25f2c6e6 Fixed #3012 (False Pos Memory Leak with a Macro) 2011-08-16 20:39:17 +02:00
Daniel Marjamäki 2150995475 Fixed #2981 (False positive: struct member leak) 2011-08-08 19:58:49 +02:00
Kimmo Varis cfcfa3f000 Use "enabled" list for the style checking.
Settings-class currently enables style checking via dedicated
boolean attribute. All other CLI's enable-options are handled
through the enable-list. This commit moves style-check enabling
to use the enable-list.

Main advantage is the consistency how options are handled/stored
in the Settings class. Which also unifies using them for the other
code. You need to enable certain type of checks? Use the
addEnabled()-method. You want to check if certain type of checks
are enabled? Use the isEnabled()-method.
2011-08-07 10:28:52 +03:00
Robert Reif 222ed6d375 fix #2971 (Wrong warning generated) 2011-08-06 19:10:15 -04:00
Daniel Marjamäki 5fc2a55bac Fixed #2900 (found memory leak in kernel p54usb and a false positive reported) 2011-08-02 09:04:13 +02:00
Daniel Marjamäki 69c3287e31 Memory leaks: fix endless loop for 'if )'. the check assumed that the link after the 'if' pointed forwards. Ticket: #2404 2011-07-31 19:38:39 +02:00
Daniel Marjamäki 4433e621f8 removed the unused function CheckMemoryLeakInFunction::matchFunctionsThatReturnArg 2011-07-31 17:36:56 +02:00
Simon Martin 50f78ce329 Fixed #2951 (Small code factorization in checkmemoryleak.cpp) 2011-07-30 13:10:44 +02:00
Daniel Marjamäki dc629b4c39 Fixed 'possible null pointer dereference' warning messages 2011-07-28 08:12:21 +02:00
Daniel Marjamäki 4e6800c474 Fixed #2921 (False positive: Memory leak with static pointer) 2011-07-24 16:08:29 +02:00
Daniel Marjamäki d34a778848 Fixed #2848 (False positive: Memory leak when assigning and freeing from another struct) 2011-07-21 13:33:20 +02:00
Robert Reif af1e51f648 fix some more false negatives for #2904 (Memory leak not detected when creating a new class instance) 2011-07-14 20:45:27 -04:00
Robert Reif 270b2b1772 fix #2904 (Memory leak not detected when creating a new class instance) 2011-07-14 19:15:59 -04:00
Reijo Tomperi 6d4799e0b8 Minor cleanup related to previous fix.
This code should not be needed anymore as tokenizer should simplify question mark away.
2011-06-30 22:10:17 +03:00
Daniel Marjamäki 6375e1d3dc Fixed #2849 (False positive: memory leak (using question mark operator)) 2011-06-30 17:31:22 +02:00
Daniel Marjamäki cacca00080 Fixed #2855 (False positive: resource leak when reusing fd) 2011-06-29 20:00:21 +02:00
Daniel Marjamäki 47a15b6486 Fixed #2830 (false positive: resource leak when using fdopen) 2011-06-20 18:42:13 +02:00
Daniel Marjamäki 1b4b4ee43e Fixed #2806 (False positive with g_strstrip()) 2011-05-29 17:44:10 +02:00
Daniel Marjamäki 52499ca8f8 Fixed #2790 (Incorrect allocation mismatch error) 2011-05-19 19:41:18 +02:00
Daniel Marjamäki 1c992fe25a Fixed #2783 (Improve check: struct member leaks when analysing c file) 2011-05-11 18:19:14 +02:00
Daniel Marjamäki a79e979ae4 Memory leaks: Fixed TODO test case. Ticket: #2733 2011-04-20 17:16:09 +02:00
Daniel Marjamäki aac65247ba Fixed #2733 (Memory leak: not all branch are checked) 2011-04-20 06:41:14 +02:00
Ettl Martin 47a1332e6a #2733 added sizeof to checkmemory-leaks white list, added a todo-testcase 2011-04-19 16:55:27 +02:00
Daniel Marjamäki 58dbbb0cab Inconclusive checking: Report inconclusive errors with reportInconclusiveError. It takes the same parameters as reportError. 2011-04-14 18:02:01 +02:00
Daniel Marjamäki e5d43d4ed2 Renamed Settings::stupid to Settings::experimental 2011-04-10 15:55:08 +02:00
Daniel Marjamäki 30ee9ba6e4 Added Settings::stupid flag that can be used to hide checking that generates false positives. 2011-04-10 13:23:45 +02:00