diff options
author | Owen Kim <owenkmg@google.com> | 2023-10-03 16:34:18 +0000 |
---|---|---|
committer | Owen Kim <owenkmg@google.com> | 2023-10-03 18:01:27 +0000 |
commit | 1852410987c2210a2fcb4018193f730e22500f2e (patch) | |
tree | c5bbc1ca3a705cacb9abddc7a7528d1bb18d1597 | |
parent | 1a02a00b80c8d0891351d7c8bbfad56c529c5ea3 (diff) | |
download | camera-1852410987c2210a2fcb4018193f730e22500f2e.tar.gz |
[GCH] Fix the memory leak when writing metdata to AIDL buffer
Bug: 301771574
Test: GCA
Change-Id: I93fb755def32671705c0874052d917e38ac1a1a1
-rw-r--r-- | common/hal/aidl_service/aidl_utils.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/hal/aidl_service/aidl_utils.cc b/common/hal/aidl_service/aidl_utils.cc index 332d1a1..ed84c50 100644 --- a/common/hal/aidl_service/aidl_utils.cc +++ b/common/hal/aidl_service/aidl_utils.cc @@ -308,8 +308,8 @@ status_t ConvertToAidlResultMetadata( } uint32_t metadata_size = hal_metadata->GetCameraMetadataSize(); - uint8_t* metadata_p = - reinterpret_cast<uint8_t*>(hal_metadata->ReleaseCameraMetadata()); + const auto* metadata_p = + reinterpret_cast<const uint8_t*>(hal_metadata->GetRawCameraMetadata()); // TODO: Do we reallly need to copy here ? aidl_metadata->assign(metadata_p, metadata_p + metadata_size); |