https://git.reactos.org/?p=reactos.git;a=commitdiff;h=92c904addc82733826dc8c9ee8c2e1d9b4cf997c

commit 92c904addc82733826dc8c9ee8c2e1d9b4cf997c
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Mon Oct 10 08:47:24 2022 +0900
Commit:     Katayama Hirofumi MZ <[email protected]>
CommitDate: Mon Oct 10 08:48:59 2022 +0900

    [SHELL32] DestroyMenu on m_pShellMenu->SetMenu failure
    
    CORE-13194
---
 dll/win32/shell32/shellmenu/CStartMenu.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dll/win32/shell32/shellmenu/CStartMenu.cpp 
b/dll/win32/shell32/shellmenu/CStartMenu.cpp
index e21bf851ada..85d61e9f3f7 100644
--- a/dll/win32/shell32/shellmenu/CStartMenu.cpp
+++ b/dll/win32/shell32/shellmenu/CStartMenu.cpp
@@ -86,13 +86,16 @@ private:
         if (FAILED_UNEXPECTEDLY(hr))
             return hr;
 
-        hr = m_pTrayPriv->AppendMenuW(&hmenu);
+        hr = m_pTrayPriv->AppendMenu(&hmenu);
         if (FAILED_UNEXPECTEDLY(hr))
             return hr;
 
         hr = m_pShellMenu->SetMenu(hmenu, NULL, SMSET_BOTTOM);
         if (FAILED_UNEXPECTEDLY(hr))
+        {
+            DestroyMenu(hmenu);
             return hr;
+        }
 
         return hr;
     }

Reply via email to