diff --git a/tree/ntuple/v7/src/RField.cxx b/tree/ntuple/v7/src/RField.cxx index e1062cd6c0795..acab4d5985ddc 100644 --- a/tree/ntuple/v7/src/RField.cxx +++ b/tree/ntuple/v7/src/RField.cxx @@ -3727,8 +3727,7 @@ void ROOT::Experimental::RUniquePtrField::ReadGlobalImpl(NTupleSize_t globalInde return; if (!isValidValue) { - valuePtr = malloc(fSubFields[0]->GetValueSize()); - CallConstructValueOn(*fSubFields[0], valuePtr); + valuePtr = CallCreateObjectRawPtrOn(*fSubFields[0]); ptr->reset(reinterpret_cast(valuePtr)); }