From 717cc8fa56b1eb39a372d0c5c561aa30dbbbdd47 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 23 May 2018 15:23:25 +0200 Subject: 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 Reviewed-by: Andy Shaw --- src/activeqt/container/qaxbase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, ¶ms, &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) { -- cgit v1.2.1