mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Fix memory leak in WifiLegacyHal. am: 84310761ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/23772717 Change-Id: I6930efc7dfd370c58e9c4f9edda19e356cd51c96 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