summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-05-23 15:23:25 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-06-06 10:56:05 +0000
commit717cc8fa56b1eb39a372d0c5c561aa30dbbbdd47 (patch)
treef8cc148b99dd473590240db9e634f24d2748bdf2
parent71408b68436445d2d4c556603e33a17db68ea680 (diff)
downloadqtactiveqt-717cc8fa56b1eb39a372d0c5c561aa30dbbbdd47.tar.gz
Fix memory leak in QAxBase::internalInvoke()
Free the return value. Patch as contributed via bug report. Task-number: QTBUG-68415 Change-Id: I9696867796db51e4b3df3830c2deb72d2b791987 Reviewed-by: Daniel Friedrich <friedrich@nanosurf.com> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
-rw-r--r--src/activeqt/container/qaxbase.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index fa3eacf..883f1e9 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -3682,8 +3682,10 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
hres = Invoke(disp, dispid, IID_NULL, LOCALE_USER_DEFAULT, wFlags, &params, &ret, &excepinfo, &argerr);
// get return value
- if (hres == S_OK && ret.vt != VT_EMPTY)
+ if (hres == S_OK && ret.vt != VT_EMPTY) {
QVariantToVoidStar(VARIANTToQVariant(ret, slot.typeName()), v[0], slot.typeName());
+ clearVARIANT(&ret);
+ }
// update out parameters
for (p = 0; p < int(params.cArgs); ++p) {