Hans Leidekker : msi: Handle NULL component correctly in MsiEnumComponentCostsW.

Alexandre Julliard julliard at winehq.org
Fri May 6 13:44:11 CDT 2011


Module: wine
Branch: master
Commit: 2afd65f69bc710b4aaeb67b8f9f50510114333b6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2afd65f69bc710b4aaeb67b8f9f50510114333b6

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Fri May  6 14:39:01 2011 +0200

msi: Handle NULL component correctly in MsiEnumComponentCostsW.

---

 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;




More information about the wine-cvs mailing list