From cea0869cdf378f178f2ff3751b7f348fa8db7bf2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 22 Aug 2006 12:21:24 +0000 Subject: [PATCH] fixed a crash and a leak in GetShortcutTarget() (closes bug 1541321) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filename.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 1be91db75f..f55a693ae8 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -1047,7 +1047,9 @@ bool wxFileName::Normalize(int flags, #include #endif -bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targetFilename, wxString* arguments) +bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, + wxString& targetFilename, + wxString* arguments) { wxString path, file, ext; wxSplitPath(shortcutPath, & path, & file, & ext); @@ -1076,6 +1078,8 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targe MAX_PATH); hres = ppf->Load(wsz, 0); + ppf->Release(); + if (SUCCEEDED(hres)) { wxChar buf[2048]; @@ -1096,11 +1100,13 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targe } } } + + psl->Release(); } - psl->Release(); return success; } -#endif + +#endif // __WIN32__ && !__WXWINCE__ // ---------------------------------------------------------------------------- -- 2.45.2