[1/7] msi: Handle NULL component correctly in MsiEnumComponentCostsW.

Hans Leidekker hans at codeweavers.com
Fri May 6 07:39:01 CDT 2011


See http://bugs.winehq.org/show_bug.cgi?id=26615
---
 dlls/msi/msi.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 867abb4..7b90203 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -1844,13 +1844,12 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i
     {
         HRESULT hr;
         IWineMsiRemotePackage *remote_package;
-        BSTR bname;
+        BSTR bname = NULL;
 
         if (!(remote_package = (IWineMsiRemotePackage *)msi_get_remote( handle )))
             return ERROR_INVALID_HANDLE;
 
-        bname = SysAllocString( component );
-        if (!bname)
+        if (component && !(bname = SysAllocString( component )))
         {
             IWineMsiRemotePackage_Release( remote_package );
             return ERROR_OUTOFMEMORY;
-- 
1.7.4.1







More information about the wine-patches mailing list