Nikolay Sivov : msxml3: Fix a leak when trying to add to readonly collection (Valgrind).

Alexandre Julliard julliard at winehq.org
Fri Apr 25 14:15:25 CDT 2014


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Apr 25 16:49:27 2014 +0400

msxml3: Fix a leak when trying to add to readonly collection (Valgrind).

---

 dlls/msxml3/schema.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/msxml3/schema.c b/dlls/msxml3/schema.c
index 2b2882c..8776de8 100644
--- a/dlls/msxml3/schema.c
+++ b/dlls/msxml3/schema.c
@@ -1193,11 +1193,14 @@ static HRESULT WINAPI schema_cache_Invoke(IXMLDOMSchemaCollection2* iface,
 static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri, VARIANT var)
 {
     schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface);
-    xmlChar* name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW);
+    xmlChar* name;
+
     TRACE("(%p)->(%s %s)\n", This, debugstr_w(uri), debugstr_variant(&var));
 
     if (This->read_only) return E_FAIL;
 
+    name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW);
+
     switch (V_VT(&var))
     {
         case VT_NULL:




More information about the wine-cvs mailing list