Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.0.2
-
None
-
Win 7 x64 SP1, VS 2010 SP1
Description
There are several calls to functions that expect parameters as a pointer to OLESTR. qaxserverbase.cpp code (at least qaxserverbase.cpp, maybe there are other ones) utilizes such calls as follows (this is one example):
hr = m_spInPlaceFrame->SetActiveObject(this, QStringToBSTR(class_name));
Here QStringToBSTR is called, which allocates memory, which in turn never gets freed. But, actually, such functions expect LPCOLESTR:
virtual HRESULT STDMETHODCALLTYPE SetActiveObject(
/* [unique][in] */ _RPC_in_opt IOleInPlaceActiveObject *pActiveObject,
/* [unique][string][in] */ _RPC_in_opt_string LPCOLESTR pszObjName) = 0;
OLESTR is not a BSTR, this is just WCHAR (WTypes.h from Win SDK):
#define OLESTR(str) L##str
So no allocations (call of QStringToBSTR) are needed, and therefore no leaks will occur.