Fix crash in oleview

Dan Hipschman dsh at
Tue Aug 1 12:49:25 CDT 2006

This fixes a crash in oleview.  The crash can be reproduced (on my system,
anyway) by opening two typelibs, and then closing the two new windows.  The
crash occurs when you close the second window.  I tracked it down to an
uninitialized pointer (lParam) which was being freed in EmptyTLTree.  This
patch initializes it to NULL which causes EmptyTLTree to not try and free it.

* Initialize TVITEM.lParam to NULL in EnumFuncs (fixes a crash)
 programs/oleview/typelib.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/programs/oleview/typelib.c b/programs/oleview/typelib.c
index 7f32cfe..3e5097c 100644
--- a/programs/oleview/typelib.c
+++ b/programs/oleview/typelib.c
@@ -243,6 +243,7 @@ int EnumFuncs(ITypeInfo *pTypeInfo, int 
         U(tvis).item.cchTextMax = SysStringLen(bstrName);
         U(tvis).item.pszText = bstrName;
+        U(tvis).item.lParam = (LPARAM)NULL;
         SendMessage(typelib.hTree, TVM_INSERTITEM, 0, (LPARAM)&tvis);

More information about the wine-patches mailing list