diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c index 0b12e29014b..228d88744b2 100644 --- a/dlls/msi/automation.c +++ b/dlls/msi/automation.c @@ -1203,11 +1203,7 @@ static HRESULT view_invoke( V_VT(pVarResult) = VT_DISPATCH; if ((ret = MsiViewFetch(This->msiHandle, &msiHandle)) == ERROR_SUCCESS) { - IDispatch *dispatch = NULL; - - if (SUCCEEDED(hr = create_record(msiHandle, &dispatch))) - V_DISPATCH(pVarResult) = dispatch; - else + if (FAILED(hr = create_record(msiHandle, &V_DISPATCH(pVarResult)))) ERR("Failed to create Record object, hresult 0x%08x\n", hr); } else if (ret == ERROR_NO_MORE_ITEMS) @@ -1684,7 +1680,6 @@ static HRESULT InstallerImpl_CreateRecord(WORD wFlags, HRESULT hr; VARIANTARG varg0; MSIHANDLE hrec; - IDispatch* dispatch; if (!(wFlags & DISPATCH_METHOD)) return DISP_E_MEMBERNOTFOUND; @@ -1700,11 +1695,7 @@ static HRESULT InstallerImpl_CreateRecord(WORD wFlags, if (!hrec) return DISP_E_EXCEPTION; - hr = create_record(hrec, &dispatch); - if (SUCCEEDED(hr)) - V_DISPATCH(pVarResult) = dispatch; - - return hr; + return create_record(hrec, &V_DISPATCH(pVarResult)); } static HRESULT InstallerImpl_OpenPackage(AutomationObject* This,