[SHELL32]
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 31 Oct 2014 09:08:43 +0000 (09:08 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 31 Oct 2014 09:08:43 +0000 (09:08 +0000)
* Plug a leak. CID 716474.
CORE-7975

svn path=/trunk/; revision=65132

reactos/dll/win32/shell32/brsfolder.cpp

index ace3308..70bf157 100644 (file)
@@ -354,11 +354,11 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf,
     tvi.cChildren= pEnumIL ? 1 : 0;
     tvi.mask |= TVIF_CHILDREN;
 
-    lptvid = (TV_ITEMDATA *)SHAlloc( sizeof(TV_ITEMDATA) );
-    if (!lptvid)
+    if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
         return NULL;
 
-    if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
+    lptvid = (TV_ITEMDATA *)SHAlloc( sizeof(TV_ITEMDATA) );
+    if (!lptvid)
         return NULL;
 
     tvi.pszText    = szBuff;