oxygen_windeco: Fix potential use-after-free from improper use of QCache<QPixmap>

Review Request #127837 - Created May 5, 2016 and submitted

Information
Michael Pyne
oxygen
master
Reviewers
kdeframeworks, plasma
oxygen windeco: Fix use-after-free for pixmap in QCache.

Coverity identified (in CID 1336171) a usage of QPixmap after it's been
the parameter to QCache<QPixmap>::insert.

This is unsafe since QCache gains ownership of whatever object is passed
in, and can even (at least in theory) delete the object you pass in.
Instead give the QCache its own copy of the pixmap.

To make this work without leaking our existing pixmap we need to work
with a QPixmap instead of QPixmap* in the non-cached case. This leads to
whitespace changes; use git diff -b to filter pure whitespace changes
out.
The new code compiles but I'm currently unable to test since kcmshell5 kwindecoration (and any other KCM viewer) is currently crashing for me in QML, due to what I'm sure is a local misconfiguration...
Hugo Pereira Da Costa
Michael Pyne
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit b595f47f021cbcf1cee23cd0bee1df57a2e2f1b9 by Michael Pyne to branch master.
Loading...