diff options
| author | Rob Mensching <rob@firegiant.com> | 2025-10-15 23:11:58 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2025-11-02 11:48:43 -0800 |
| commit | 8a24574018dc4ac39ec5988b87aff797e22b187b (patch) | |
| tree | e52c3964bb6564764caa3f2c958698eeffceb636 /src/ext/Firewall/ca/firewall.cpp | |
| parent | 27591327bc439c10c72e225081f574d5318b1714 (diff) | |
| download | wix-8a24574018dc4ac39ec5988b87aff797e22b187b.tar.gz wix-8a24574018dc4ac39ec5988b87aff797e22b187b.tar.bz2 wix-8a24574018dc4ac39ec5988b87aff797e22b187b.zip | |
Do not use Exit macros for control flow
Fixes 9172
Diffstat (limited to '')
| -rw-r--r-- | src/ext/Firewall/ca/firewall.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/ext/Firewall/ca/firewall.cpp b/src/ext/Firewall/ca/firewall.cpp index f50ae409..dfe8ecf1 100644 --- a/src/ext/Firewall/ca/firewall.cpp +++ b/src/ext/Firewall/ca/firewall.cpp | |||
| @@ -464,29 +464,30 @@ static HRESULT GetFwRuleInterfaces( | |||
| 464 | } | 464 | } |
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | ExitOnNull(iInterfacesCount, hr, S_OK, "All interfaces are empty values"); | 467 | if (iInterfacesCount > 0) |
| 468 | |||
| 469 | vInterfaces.vt = VT_ARRAY | VT_VARIANT; | ||
| 470 | // this will be cleaned up by ReleaseVariant call of the calling function | ||
| 471 | vInterfaces.parray = SafeArrayCreateVector(VT_VARIANT, 0, iInterfacesCount); | ||
| 472 | |||
| 473 | for (LPCWSTR pwzElement = bstrInterfaces; pwzElement < (bstrInterfaces + iLength); ++pwzElement) | ||
| 474 | { | 468 | { |
| 475 | if (*pwzElement) | 469 | vInterfaces.vt = VT_ARRAY | VT_VARIANT; |
| 470 | // this will be cleaned up by ReleaseVariant call of the calling function | ||
| 471 | vInterfaces.parray = SafeArrayCreateVector(VT_VARIANT, 0, iInterfacesCount); | ||
| 472 | |||
| 473 | for (LPCWSTR pwzElement = bstrInterfaces; pwzElement < (bstrInterfaces + iLength); ++pwzElement) | ||
| 476 | { | 474 | { |
| 477 | VARIANT vElement; | 475 | if (*pwzElement) |
| 478 | ::VariantInit(&vElement); | 476 | { |
| 477 | VARIANT vElement; | ||
| 478 | ::VariantInit(&vElement); | ||
| 479 | 479 | ||
| 480 | vElement.vt = VT_BSTR; | 480 | vElement.vt = VT_BSTR; |
| 481 | // this will be cleaned up by ReleaseVariant call of the calling function | 481 | // this will be cleaned up by ReleaseVariant call of the calling function |
| 482 | vElement.bstrVal = ::SysAllocString(pwzElement); | 482 | vElement.bstrVal = ::SysAllocString(pwzElement); |
| 483 | ExitOnNull(vElement.bstrVal, hr, E_OUTOFMEMORY, "failed SysAllocString for interface element"); | 483 | ExitOnNull(vElement.bstrVal, hr, E_OUTOFMEMORY, "failed SysAllocString for interface element"); |
| 484 | 484 | ||
| 485 | hr = SafeArrayPutElement(vInterfaces.parray, &iIndex, &vElement); | 485 | hr = SafeArrayPutElement(vInterfaces.parray, &iIndex, &vElement); |
| 486 | ExitOnFailure(hr, "failed to put interface '%ls' into safe array", pwzElement); | 486 | ExitOnFailure(hr, "failed to put interface '%ls' into safe array", pwzElement); |
| 487 | 487 | ||
| 488 | pwzElement += ::SysStringLen(vElement.bstrVal); | 488 | pwzElement += ::SysStringLen(vElement.bstrVal); |
| 489 | iIndex++; | 489 | iIndex++; |
| 490 | } | ||
| 490 | } | 491 | } |
| 491 | } | 492 | } |
| 492 | 493 | ||
