Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.7, 5.15.2
-
None
-
OpenSuse 15.3
Description
I've found a memory leak in QXmlSchema.
$ valgrind --tool=memcheck --leak-check=full ./test ==21494== 27,468 (96 direct, 27,372 indirect) bytes in 3 blocks are definitely lost in loss record 5,346 of 5,367 ==21494== at 0x4C332EF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==21494== by 0x6BDEDF1: QListData::detach_grow(int*, int) (in /usr/lib64/libQt5Core.so.5.12.7) ==21494== by 0x63279D9: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) ==21494== by 0x6327B4E: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) ==21494== by 0x63B93C9: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) ==21494== by 0x63BA47D: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) ==21494== by 0x63BAA12: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) ==21494== by 0x622414C: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) ==21494== by 0x622444A: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) ==21494== by 0x62233AD: QXmlSchema::load(QByteArray const&, QUrl const&) (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) ==21494== by 0x4033E0: Dialog::test() (dialog.cpp:35) ==21494== by 0x403D44: Dialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_dialog.cpp:71) ==21494==
The presence and size of the leak depends on the file being uploaded. It is recommended to test the file included in the test project.
QXmlSchema sch; QDomDocument xsddoc; QFile filexsd("./settings.xsd"); if(filexsd.open(QIODevice::ReadOnly | QIODevice::Text)){ qDebug()<< "open xsd\n"; if(xsddoc.setContent(&filexsd)){ sch.load(xsddoc.toByteArray()); qDebug()<< "loaded xsd\n"; } filexsd.close(); }
This behavior is similar to earlier in QTBUG-62691