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;
Attachments
For Gerrit Dashboard: QTBUG-118996 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
517156,4 | Fix Memory leak in in qprotobufserializer.h | dev | qt/qtgrpc | Status: MERGED | +2 | 0 |
517546,3 | Fix Memory leak in in qprotobufserializer.h | 6.6 | qt/qtgrpc | Status: MERGED | +2 | 0 |
528606,7 | Avoid deleting oneof pointer if it points to oneof QVariant data | dev | qt/qtgrpc | Status: MERGED | +2 | 0 |
529299,2 | Avoid deleting oneof pointer if it points to oneof QVariant data | 6.7 | qt/qtgrpc | Status: MERGED | +2 | 0 |
529427,1 | Avoid deleting oneof pointer if it points to oneof QVariant data | 6.6 | qt/qtgrpc | Status: ABANDONED | 0 | 0 |