Review Request 121380: Krita - Fix some memory leaks.

Stefano Bonicatti smjert at gmail.com
Sun Dec 7 14:48:15 GMT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121380/
-----------------------------------------------------------

Review request for Calligra.


Repository: calligra


Description
-------

Fix some memory leaks around the code, found thanks to cppcheck.

kis_datamanager_benchmark.cpp and kis_compression_tests.cpp: even if maybe they aren't used, better be safe than sorry.
kis_brush.cpp: a simple mismatch in the new/delete.
kis_dropshadow.cc: sum pointer is leaking by pointing at new memory without freeing it first. The function too exits without freeing sum new memory. I've removed the switches because delete[] makes a null check anyway so there's no issue and if in the future someone changes code to allocate those in other cases, they won't leak.


Diffs
-----

  krita/benchmarks/kis_datamanager_benchmark.cpp b565abf 
  krita/image/tiles3/tests/kis_compression_tests.cpp 505986b 
  krita/libbrush/kis_brush.cpp 4cb0e36 
  krita/plugins/extensions/dropshadow/kis_dropshadow.cc 388b8f7 

Diff: https://git.reviewboard.kde.org/r/121380/diff/


Testing
-------

Compiling against master.
Rerun cppcheck and issues are gone.


Thanks,

Stefano Bonicatti

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20141207/ab5cfcd0/attachment.htm>


More information about the calligra-devel mailing list