On 8 November 2013 06:22, Pavel Roschin <roshin@scriptumplus.ru> wrote:
Moving forward to the software source code analysis. Updated more than 300
alloc-functions for GLib.

Here are new results (better and better):

https://gist.github.com/scriptum/7360333

Nice, had a chance to check a couple while sitting in an airport.

symbols.c:1093 arrrrrggghh, keeping the buffer between function invocations!!! Why??  But its not a leak.

build.c:2416 build.c:2633 technical leak, doesn't happen in any real Geany, needs a menu of >100 items to trigger, replace the return by break to fix

build.c printfs are a debugging facility that is never used AFAICT and are always compiled out, but are safe anyway since the small unsigned ints have the same values as small signed ints.

utils.c:1844 yes, leaks.
All the g_return_if_fail() calls in that function s/b replaced, the returns are not errors, there is no need to print a message if they occur, the tests are required, but g_return_if_fail() can be compiled out.

document.c:528 false pos, the doc allocated at 522 is added to the array at 525 not leaked, could be silenced by using a different GeanyDocument* temporary variable.

Your other assessments of false positives look right.

Cheers
Lex



Updated rules:
https://github.com/scriptum/cppcheck-libs

--
Best regards,
Pavel Roschin aka RPG
_______________________________________________
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel