summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-10-16 10:14:08 +0200
committerMarc Mutz <marc.mutz@kdab.com>2014-10-19 13:18:18 +0200
commit9dcc38b566576ab209a133777fc2d92bdf33c183 (patch)
tree0a20ccc20ecd61cb868a98049530a7c1d0b700f2 /src/corelib/tools
parent665966d243c37d384d9529f47cd4456b621e05dd (diff)
QEasingCurve: fix mem leak in operator>>
The code ignored that the QEasingCurve passed in to op>> might already have a QEasingCurveFunction set, overwriting it with a new pointer without deleting the old. Change-Id: Ic14cf7e4b97c7c8c7edb64cde08fbf22c07ac8f3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qeasingcurve.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 0e3375cf21..a3dd4d9a60 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -1497,6 +1497,8 @@ QDataStream &operator>>(QDataStream &stream, QEasingCurve &easing)
bool hasConfig;
stream >> hasConfig;
+ delete easing.d_ptr->config;
+ easing.d_ptr->config = Q_NULLPTR;
if (hasConfig) {
QEasingCurveFunction *config = curveToFunctionObject(type);
stream >> config->_p;