Author: janderwald
Date: Sun Oct 21 20:20:14 2007
New Revision: 29739
URL:
http://svn.reactos.org/svn/reactos?rev=29739&view=rev
Log:
- fix memory leak
Modified:
trunk/reactos/dll/cpl/appwiz/appwiz.h
trunk/reactos/dll/cpl/appwiz/createlink.c
Modified: trunk/reactos/dll/cpl/appwiz/appwiz.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.h?re…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/appwiz.h (original)
+++ trunk/reactos/dll/cpl/appwiz/appwiz.h Sun Oct 21 20:20:14 2007
@@ -1,6 +1,7 @@
#ifndef __CPL_APPWIZ_H
#define __CPL_APPWIZ_H
+#define COBJMACROS
#include <windows.h>
#include <windowsx.h> /* GET_X/Y_LPARAM */
#include <commctrl.h>
Modified: trunk/reactos/dll/cpl/appwiz/createlink.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/createlink.…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/createlink.c (original)
+++ trunk/reactos/dll/cpl/appwiz/createlink.c Sun Oct 21 20:20:14 2007
@@ -61,6 +61,7 @@
WCHAR szDesc[100];
BROWSEINFOW brws;
LPITEMIDLIST pidllist;
+ IMalloc* malloc;
switch(uMsg)
{
@@ -98,6 +99,13 @@
if (SHGetPathFromIDList(pidllist, szPath))
SendDlgItemMessage(hwndDlg, IDC_SHORTCUT_LOCATION, WM_SETTEXT, 0,
(LPARAM)szPath);
+
+ /* Free memory, if possible */
+ if (SUCCEEDED(SHGetMalloc(&malloc)))
+ {
+ IMalloc_Free(malloc, pidllist);
+ IMalloc_Release(malloc);
+ }
break;
}