Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-118996

Memory leak in qprotobufserializer.h

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.6.1, 6.7.0 FF
    • 6.6.0 RC
    • Protocol Buffers
    • None
    • Linux/X11
    • 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

        Activity

          People

            tatiana.borisova Tatiana Borisova
            ntrandafil Николай Трандафил
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews