Hans Leidekker : fusion: Fix some memory leaks.

Alexandre Julliard julliard at winehq.org
Mon Dec 7 10:26:17 CST 2009


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Dec  7 09:54:38 2009 +0100

fusion: Fix some memory leaks.

Found by Valgrind.

---

 dlls/fusion/asmname.c       |    5 +++++
 dlls/fusion/tests/asmenum.c |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/fusion/asmname.c b/dlls/fusion/asmname.c
index 913674a..3c014ea 100644
--- a/dlls/fusion/asmname.c
+++ b/dlls/fusion/asmname.c
@@ -471,6 +471,11 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
 
 done:
     HeapFree(GetProcessHeap(), 0, save);
+    if (FAILED(hr))
+    {
+        HeapFree(GetProcessHeap(), 0, name->displayname);
+        HeapFree(GetProcessHeap(), 0, name->name);
+    }
     return hr;
 }
 
diff --git a/dlls/fusion/tests/asmenum.c b/dlls/fusion/tests/asmenum.c
index 48f7b2a..cb6ea3d 100644
--- a/dlls/fusion/tests/asmenum.c
+++ b/dlls/fusion/tests/asmenum.c
@@ -209,6 +209,8 @@ static void test_CreateAssemblyEnum(void)
     ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
     ok(asmenum == (IAssemblyEnum *)0xdeadbeef,
        "Expected asmenum to be unchanged, got %p\n", asmenum);
+
+    IAssemblyName_Release(asmname);
 }
 
 typedef struct _tagASMNAME




More information about the wine-cvs mailing list