Rob Shearman : oleaut32: Fix memory leaks in LPSAFEARRAY and VT_CARRAY marshalling.

Alexandre Julliard julliard at winehq.org
Mon Nov 16 11:43:53 CST 2009


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

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Sun Nov 15 17:12:50 2009 +0000

oleaut32: Fix memory leaks in LPSAFEARRAY and VT_CARRAY marshalling.

---

 dlls/oleaut32/tmarshal.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index eae17e2..0e9d7eb 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -894,6 +894,8 @@ serialize_param(
 	    if (debugout && (i<arrsize-1)) TRACE_(olerelay)(",");
 	}
 	if (debugout) TRACE_(olerelay)("]");
+	if (dealloc)
+	    HeapFree(GetProcessHeap(), 0, *(void **)arg);
 	return S_OK;
     }
     case VT_SAFEARRAY: {
@@ -905,6 +907,11 @@ serialize_param(
             LPSAFEARRAY_UserMarshal(&flags, buf->base + buf->curoff, (LPSAFEARRAY *)arg);
             buf->curoff = size;
         }
+        if (dealloc)
+        {
+            ULONG flags = MAKELONG(MSHCTX_DIFFERENTMACHINE, NDR_LOCAL_DATA_REPRESENTATION);
+            LPSAFEARRAY_UserFree(&flags, (LPSAFEARRAY *)arg);
+        }
         return S_OK;
     }
     default:




More information about the wine-cvs mailing list