Module: wine Branch: master Commit: 846811be594b8ce3b391662d9d35a2b5fc91ca49 URL: http://source.winehq.org/git/wine.git/?a=commit;h=846811be594b8ce3b391662d9d...
Author: Hans Leidekker hans@codeweavers.com Date: Thu Apr 14 14:39:55 2011 +0200
msi: Check the return value of MSIREG_OpenUpgradeCodesKey (valgrind).
---
dlls/msi/action.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 3244b6d..8267aa9 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -5293,8 +5293,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) WCHAR squashed_pc[SQUISH_GUID_SIZE]; MSIRECORD *uirow; LPWSTR upgrade_code; - HKEY hkey, props; - HKEY upgrade; + HKEY hkey, props, upgrade_key; UINT rc;
/* FIXME: also need to publish if the product is in advertise mode */ @@ -5325,11 +5324,14 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) upgrade_code = msi_dup_property(package->db, szUpgradeCode); if (upgrade_code) { - MSIREG_OpenUpgradeCodesKey(upgrade_code, &upgrade, TRUE); - squash_guid(package->ProductCode, squashed_pc); - msi_reg_set_val_str(upgrade, squashed_pc, NULL); - RegCloseKey(upgrade); - msi_free(upgrade_code); + rc = MSIREG_OpenUpgradeCodesKey( upgrade_code, &upgrade_key, TRUE ); + if (rc == ERROR_SUCCESS) + { + squash_guid( package->ProductCode, squashed_pc ); + msi_reg_set_val_str( upgrade_key, squashed_pc, NULL ); + RegCloseKey( upgrade_key ); + } + msi_free( upgrade_code ); }
done: