From e4868d563574853d40ca04adfc28db1c19ca9dbf Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Wed, 8 Apr 2015 10:59:33 -0500 Subject: [PATCH] shell32: Allocate returned array in IKnownFolderManager::GetFolderIds. --- dlls/shell32/shellpath.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index d853274dd49..731ea2f5b74 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -4178,7 +4178,8 @@ static HRESULT WINAPI foldermanager_GetFolderIds( TRACE("%p, %p\n", ppKFId, pCount); - *ppKFId = fm->ids; + *ppKFId = CoTaskMemAlloc(fm->num_ids * sizeof(KNOWNFOLDERID)); + memcpy(*ppKFId, fm->ids, fm->num_ids * sizeof(KNOWNFOLDERID)); *pCount = fm->num_ids; return S_OK; }