avifil32: Use CoTaskMemAlloc when allocating memory to return through
an OLE interface.
This commit is contained in:
parent
610fc08e8d
commit
29212d8afd
|
@ -704,7 +704,7 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface,
|
||||||
if (This->paf->szFileName != NULL) {
|
if (This->paf->szFileName != NULL) {
|
||||||
int len = lstrlenW(This->paf->szFileName) + 1;
|
int len = lstrlenW(This->paf->szFileName) + 1;
|
||||||
|
|
||||||
*ppszFileName = (LPOLESTR)GlobalAllocPtr(GHND, len * sizeof(WCHAR));
|
*ppszFileName = CoTaskMemAlloc(len * sizeof(WCHAR));
|
||||||
if (*ppszFileName == NULL)
|
if (*ppszFileName == NULL)
|
||||||
return AVIERR_MEMORY;
|
return AVIERR_MEMORY;
|
||||||
|
|
||||||
|
|
|
@ -662,7 +662,7 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface,
|
||||||
if (This->paf->szFileName != NULL) {
|
if (This->paf->szFileName != NULL) {
|
||||||
int len = lstrlenW(This->paf->szFileName) + 1;
|
int len = lstrlenW(This->paf->szFileName) + 1;
|
||||||
|
|
||||||
*ppszFileName = GlobalAllocPtr(GHND, len * sizeof(WCHAR));
|
*ppszFileName = CoTaskMemAlloc(len * sizeof(WCHAR));
|
||||||
if (*ppszFileName == NULL)
|
if (*ppszFileName == NULL)
|
||||||
return AVIERR_MEMORY;
|
return AVIERR_MEMORY;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue