Rob Shearman : oleaut32: Fix memory leaks after calling ITypeInfo::GetNames .

Alexandre Julliard julliard at wine.codeweavers.com
Mon Oct 23 10:02:54 CDT 2006


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Mon Oct 23 11:29:09 2006 +0100

oleaut32: Fix memory leaks after calling ITypeInfo::GetNames.

---

 dlls/oleaut32/tmarshal.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index ac4d407..759c74c 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -741,16 +741,6 @@ serialize_param(
 		    ERR("Could not get vardesc of %d\n",i);
 		    return hres;
 		}
-		/* Need them for hack below */
-		/*
-		memset(names,0,sizeof(names));
-		hres = ITypeInfo_GetNames(tinfo2,vdesc->memid,names,sizeof(names)/sizeof(names[0]),&nrofnames);
-		if (nrofnames > sizeof(names)/sizeof(names[0])) {
-		    ERR("Need more names!\n");
-		}
-		if (!hres && debugout)
-		    TRACE_(olerelay)("%s=",relaystr(names[0]));
-		*/
 		elem2 = &vdesc->elemdescVar;
 		tdesc2 = &elem2->tdesc;
 		hres = serialize_param(
@@ -1382,6 +1372,8 @@ xCall(LPVOID retptr, int method, TMProxy
     hres = remoteresult;
 
 exit:
+    for (i = 0; i < nrofnames; i++)
+        SysFreeString(names[i]);
     HeapFree(GetProcessHeap(),0,buf.base);
     IRpcChannelBuffer_Release(chanbuf);
     ITypeInfo_Release(tinfo);
@@ -1849,6 +1841,10 @@ TMStubImpl_Invoke(
     }
 
     hres = xbuf_add (&buf, (LPBYTE)&res, sizeof(DWORD));
+
+    for (i = 0; i < nrofnames; i++)
+        SysFreeString(names[i]);
+
     if (hres != S_OK)
 	return hres;
 




More information about the wine-cvs mailing list