From cb700ebc64cdaaed2682933ce2304c5164e9e703 Mon Sep 17 00:00:00 2001 From: "Liu, Kai1" Date: Tue, 12 Dec 2023 19:20:49 +0800 Subject: [PATCH] Make sure the VehiclePropValue object is initialized If MALLOC_ZERO_CONTENTS is false, the new created VehiclePropValue object maybe filled with dirty data, we should initialize it so that its status member can be initialized to zero to avoid timeout when car services get properties, such as property OBD2_LIVE_FRAME. Bug: 315728228 Test: hidl_test Change-Id: I530bc95a3074c917be853f55cd1736558b140da4 Signed-off-by: Liu, Kai1 --- automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp b/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp index c16b29a2e7..03a9df579b 100644 --- a/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp +++ b/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp @@ -30,7 +30,7 @@ namespace V2_0 { std::unique_ptr createVehiclePropValue( VehiclePropertyType type, size_t vecSize) { - auto val = std::unique_ptr(new VehiclePropValue); + auto val = std::unique_ptr(new VehiclePropValue()); switch (type) { case VehiclePropertyType::INT32: // fall through case VehiclePropertyType::INT32_VEC: // fall through