Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb700ebc authored by Liu, Kai1's avatar Liu, Kai1
Browse files

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: default avatarLiu, Kai1 <kai1.liu@intel.com>
parent 64930a63
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ namespace V2_0 {

std::unique_ptr<VehiclePropValue> createVehiclePropValue(
    VehiclePropertyType type, size_t vecSize) {
    auto val = std::unique_ptr<VehiclePropValue>(new VehiclePropValue);
    auto val = std::unique_ptr<VehiclePropValue>(new VehiclePropValue());
    switch (type) {
        case VehiclePropertyType::INT32:      // fall through
        case VehiclePropertyType::INT32_VEC:  // fall through