oleaut32: Fix memory leaks in LPSAFEARRAY and VT_CARRAY marshalling.

This commit is contained in:
Rob Shearman 2009-11-15 17:12:50 +00:00 committed by Alexandre Julliard
parent b5139f45b3
commit 8bd2d5395d
1 changed files with 7 additions and 0 deletions

View File

@ -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: