Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.6.0 RC
-
None
-
-
e9c80d43f (dev), 242071cd6 (6.6), a026b8177 (dev), a7beb2f12 (6.7)
Description
My program is compiled with `-fsanitize=leak` and it detects leak in `deserializeObject` function, specifically in this function
template<typename T, typename std::enable_if_t<std::is_base_of<QProtobufMessage, T>::value, int> = 0> void deserializeObject(const QProtobufSerializer *serializer, QProtobufSelfcheckIterator &it, QVariant &to) { Q_ASSERT_X(serializer != nullptr, "QProtobufSerializer", "Serializer is null"); Q_ASSERT_X(to.isNull() || to.metaType() == QMetaType::fromType<T *>(), "QProtobufSerializer", "Property should be either uninitialized or contain a valid pointer"); T *value = to.value<T *>(); if (value == nullptr) { value = new T; to = QVariant::fromValue<T *>(value); } serializer->deserializeObject(value, T::propertyOrdering, it); }// code placeholder
in the instruction
value = new T;