Commit Graph

166 Commits

Author SHA1 Message Date
Daniel Marjamäki 93659bbe08 memory leaks: fixed a todo testcase to find more leaks 2009-09-01 20:12:53 +02:00
Daniel Marjamäki 9a47b7110e memory leaks: fixed todo testcases to find more memory leaks 2009-09-01 20:02:28 +02:00
Slava Semushin ca053bf8f9 CheckMemoryLeakInFunction: print simplified tokens only with --debug and --verbose.
Suggested by aggro80@ and approved by hyd_danmar@ in IRC.
2009-09-02 00:54:40 +07:00
Daniel Marjamäki 7ba244cf45 Memory leaks: fixed a todo testcase 2009-09-01 19:33:17 +02:00
Daniel Marjamäki 960fb861da Refactoring: Refactoring of the unit testing for the CheckMemoryLeakInFunction 2009-08-30 21:11:15 +02:00
Reijo Tomperi fc343b3e9e astyle fix 2009-08-29 23:33:12 +03:00
Daniel Marjamäki 9d7defad22 Fixed #615 (Memleak was detected in 1.32 but not in 1.33 and later) 2009-08-29 17:33:57 +02:00
Daniel Marjamäki 1dd2ec4757 Fixed #414 (memory leak in if-else construct not detected) 2009-08-29 16:55:43 +02:00
Daniel Marjamäki 270d2b2d4f memory leaks: improved the simplification of 'if* ;' 2009-08-29 16:27:16 +02:00
Daniel Marjamäki 8f1f89ae2b memory leaks: fixed todo test case. reduce exit better 2009-08-29 16:03:23 +02:00
Daniel Marjamäki b5c6d7ba49 memory leaks: fixed bug. return|else are not part of a variable declaration 2009-08-29 15:20:37 +02:00
Slava Semushin 78d44e67ef CheckMemoryLeakInFunction(getcode): don't call Token::Match() if varid equals to zero. 2009-08-29 16:27:56 +07:00
Daniel Marjamäki 6347d0e976 memory leaks: better handling of open/close 2009-08-29 09:18:21 +02:00
Daniel Marjamäki 88d0bd3908 astyle 2009-08-29 08:20:18 +02:00
Daniel Marjamäki ee5b2a43c7 Fixed #627 (False positive with --all, Resource leak with open()) 2009-08-29 07:43:44 +02:00
Daniel Marjamäki de9e62e90a Memory leaks: handling asprintf better 2009-08-29 07:26:32 +02:00
Daniel Marjamäki 406fdd3219 Memory leaks: Fixed two todo testcases (getcode handling of asprintf) 2009-08-29 07:02:36 +02:00
Daniel Marjamäki ab047c680c memory leaks: fixed a todo testcase 2009-08-29 06:42:24 +02:00
Daniel Marjamäki 74fd052fc0 Memory leaks: Testing that asprintf is handled correctly 2009-08-28 23:26:40 +02:00
Reijo Tomperi bf4ac5521d astyle fix 2009-08-28 23:29:08 +03:00
danmar 3b2744e04a borland c++: fixed compiler errors 2009-08-28 10:22:40 +02:00
Slava Semushin 8dcb846627 Fixed #614 (If you see this, there is a bug ###### Token::Match() - varid was 0)
http://sourceforge.net/apps/trac/cppcheck/ticket/614
2009-08-26 02:44:19 +07:00
Slava Semushin 311fb1a1f8 src/checkmemoryleak.{h,cpp}: minor improvements.
Corrections for commit 0d6b6e840d

No functional change.
2009-08-26 02:32:10 +07:00
Slava Semushin ff3d1db480 Replace "const unsigned int" to "unsigned int" in methods parameters.
No functional change.
2009-08-26 02:26:12 +07:00
Daniel Marjamäki 522f4c18c8 astyle formatting 2009-08-23 17:17:57 +02:00
Daniel Marjamäki 9da2ecf4f4 Refactoring the unit testing. Wrote special tests for CheckMemoryLeakInFunction::findleak 2009-08-23 15:48:25 +02:00
Benjamin Kramer 0d6b6e840d Improve performance by using bsearch(3) instead of a std::set
The function name list is already in memory so we can avoid copying it into a std::set
if we sort the list alphabetically. This way no binary search tree has to be allocated.

Before (best of 5 runs):
./testrunner > /dev/null  0,21s user 0,00s system 95% cpu 0,221 total
After (best of 5 runs):
./testrunner > /dev/null  0,20s user 0,00s system 95% cpu 0,210 total
2009-08-22 20:24:26 +02:00
Daniel Marjamäki 8b46172bcf Memory leaks: Use varid instead of varname 2009-08-19 19:42:07 +02:00
Daniel Marjamäki 85682ed429 Fixed #591 (False positive: Deallocating a deallocated pointer) 2009-08-18 20:49:08 +02:00
Daniel Marjamäki 2cdb0abb82 Refactoring: Use the Token::link instead of loop 2009-08-17 22:23:37 +02:00
Daniel Marjamäki 52856fcbeb ettlmartin: improved the MathLib::IsInt 2009-08-16 18:45:26 +02:00
Slava Semushin 522f783ada CheckMemoryLeak: try to speed up call_func().
Using std::set::find() instead of sequence of Match() calls.
2009-08-16 22:02:11 +07:00
Daniel Marjamäki ecdbcbce3d Fixed #566 (False positive when assigning the return value of realloc(NULL,..) to a pointer variable holding a freed memory address) 2009-08-10 22:04:28 +02:00
Daniel Marjamäki ce8c5b0236 Fixed #555 (False positive: [CuTest.c:25]: (error) Memory leak: len) 2009-08-05 21:18:16 +02:00
Daniel Marjamäki cb57bd6678 Listing error messages in XML format 2009-08-04 21:36:55 +02:00
Daniel Marjamäki 9e348ca739 Fixed #554 (resource leak false positive) 2009-08-04 21:34:14 +02:00
Reijo Tomperi 769119c725 Fix ticket #552 (False positive with --all when realloc is used with two variables.)
http://sourceforge.net/apps/trac/cppcheck/ticket/552
2009-08-02 23:30:43 +03:00
Reijo Tomperi 10f6678cf9 TODO test case realloc5 added and "Checkmemoryleak: simplifycode result for" debug info added. 2009-08-02 22:23:47 +03:00
Daniel Marjamäki b7ffcf53ba Fixed #511 (false positive, memory leak when using 'var = ({});') 2009-07-31 23:42:21 +02:00
Daniel Marjamäki 050b85c5eb memory leak for struct member: fixed false positive when the struct pointer is stored away 2009-07-29 11:38:20 +02:00
Slava Semushin 65d6bce165 Replace Match() to operator==() from std::string.
No functional change.
2009-07-28 00:13:44 +07:00
Slava Semushin 5ce151983e Replace simpleMatch() to operator==() from std::string.
No functional change.
2009-07-28 00:13:11 +07:00
Slava Semushin 8643936e0c Fixed ticket #500 (Tokenizer: simplify the "(p != NULL)" conditions)
Also teach simplifyIfNot() to handle variables like Foo::var.

https://sourceforge.net/apps/trac/cppcheck/ticket/500
2009-07-25 18:23:03 +07:00
Daniel Marjamäki 9136d8cf80 Tokenizer: simplify return statements - remove redundant parantheses 2009-07-24 21:55:35 +02:00
Daniel Marjamäki 6bb85703f6 memory leaks: fixed false positive for struct members - better handling of if/else 2009-07-24 09:05:40 +02:00
Daniel Marjamäki 565ac2fca6 Fixed #493 (Memory leak: False positive when using the exit(0)) 2009-07-23 16:30:30 +02:00
Daniel Marjamäki 3243933c90 Fixed #494 (False positives of checking leaks struct members)
Better handling of function calls
2009-07-22 08:30:51 +02:00
Daniel Marjamäki 6f646246ee dereferencing deallocated memory: it is ok to take the address to deallocated memory but it is not ok to dereference the address 2009-07-21 13:04:13 +02:00
Reijo Tomperi d2278b5ce0 Fix some of the issues from #478 (Warnings in Visual Studio build with -W4)
http://sourceforge.net/apps/trac/cppcheck/ticket/478
2009-07-20 23:24:23 +03:00
Daniel Marjamäki 74699cab66 memory leak for struct member: made the checking more sensitive. Skip bail-out execution paths were the member is properly deallocated 2009-07-20 14:39:24 +02:00