Michael Stefaniuc : dmloader: Don't leak memory in the cache.

Alexandre Julliard julliard at winehq.org
Tue Jul 25 16:11:27 CDT 2017


Module: wine
Branch: master
Commit: ad0dbe3e02fab0e8586a2363c2b887761917f7f8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ad0dbe3e02fab0e8586a2363c2b887761917f7f8

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Tue Jul 25 20:57:26 2017 +0200

dmloader: Don't leak memory in the cache.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dmloader/loader.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index bed8cd0..1f73697 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -172,9 +172,7 @@ static ULONG WINAPI IDirectMusicLoaderImpl_Release(IDirectMusicLoader8 *iface)
     if (!ref) {
         unsigned int i;
 
-        /* Firstly, release the cache */
         IDirectMusicLoader8_ClearCache(iface, &GUID_DirectMusicAllTypes);
-        /* FIXME: Release all allocated entries */
         for (i = 0; i < ARRAY_SIZE(classes); i++)
             HeapFree(GetProcessHeap(), 0, This->search_paths[i]);
         HeapFree(GetProcessHeap(), 0, This);
@@ -806,6 +804,8 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ClearCache(IDirectMusicLoader8 *ifa
             (obj->Desc.dwValidData & DMUS_OBJ_LOADED)) {
             /* basically, wrap to ReleaseObject for each object found */
             IDirectMusicLoader8_ReleaseObject(iface, obj->pObject);
+            list_remove(&obj->entry);
+            HeapFree(GetProcessHeap(), 0, obj);
         }
     }
 




More information about the wine-cvs mailing list