[PATCH] wmp: Fix memory leak in IWMP[Media|Playlist]::put_name.

Gijs Vermeulen gijsvrm at codeweavers.com
Fri Aug 9 12:09:49 CDT 2019


Signed-off-by: Gijs Vermeulen <gijsvrm at codeweavers.com>
---
 dlls/wmp/player.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/wmp/player.c b/dlls/wmp/player.c
index 03a7d26003..729cc81f9c 100644
--- a/dlls/wmp/player.c
+++ b/dlls/wmp/player.c
@@ -1819,6 +1819,7 @@ static HRESULT WINAPI WMPMedia_put_name(IWMPMedia *iface, BSTR name)
 
     if (!name) return E_POINTER;
 
+    heap_free(This->name);
     This->name = heap_strdupW(name);
     return S_OK;
 }
@@ -2063,6 +2064,7 @@ static HRESULT WINAPI WMPPlaylist_put_name(IWMPPlaylist *iface, BSTR name)
 
     if (!name) return E_POINTER;
 
+    heap_free(This->name);
     This->name = heap_strdupW(name);
     return S_OK;
 }
-- 
2.22.0




More information about the wine-devel mailing list