mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
Fix memory leak in WifiLegacyHal. am: 84310761ce am: aa1f8755c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/23772717 Change-Id: I0954dbcf561b6e16bb98ebb69fa5238031eea0f1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1452,14 +1452,24 @@ WifiChip::getSupportedRadioCombinationsInternal() {
|
||||
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
|
||||
LOG(ERROR) << "Failed to get SupportedRadioCombinations matrix from legacy HAL: "
|
||||
<< legacyErrorToString(legacy_status);
|
||||
if (legacy_matrix != nullptr) {
|
||||
free(legacy_matrix);
|
||||
}
|
||||
return {aidl_combinations, createWifiStatusFromLegacyError(legacy_status)};
|
||||
}
|
||||
|
||||
if (!aidl_struct_util::convertLegacyRadioCombinationsMatrixToAidl(legacy_matrix,
|
||||
&aidl_combinations)) {
|
||||
LOG(ERROR) << "Failed convertLegacyRadioCombinationsMatrixToAidl() ";
|
||||
if (legacy_matrix != nullptr) {
|
||||
free(legacy_matrix);
|
||||
}
|
||||
return {aidl_combinations, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)};
|
||||
}
|
||||
|
||||
if (legacy_matrix != nullptr) {
|
||||
free(legacy_matrix);
|
||||
}
|
||||
return {aidl_combinations, ndk::ScopedAStatus::ok()};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user