Skip to content

Fix leaks in KateConfigDialog

Waqar Ahmed requested to merge work/fix-leaks-in-config into master

Leak reported by sanitizer. Also, I don't see any good reason to use a pointer here anyways

==208745==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 355 byte(s) in 9 object(s) allocated from:
    #0 0x563e4afa7e19 in malloc (/home/waqar/kde/usr/bin/kate+0x133e19)
    #1 0x7fac84a3d606 in editorconfig_parse (/usr/lib/libeditorconfig.so.0+0x3606)

Direct leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x563e4afa7e19 in malloc (/home/waqar/kde/usr/bin/kate+0x133e19)
    #1 0x7fac810b0d25  (/usr/lib/libfontconfig.so.1+0x20d25)

Direct leak of 240 byte(s) in 6 object(s) allocated from:
    #0 0x563e4afddc59 in operator new(unsigned long) (/home/waqar/kde/usr/bin/kate+0x169c59)
    #1 0x563e4b1fc334 in KateConfigDialog::addPluginPage(KTextEditor::Plugin*) /home/waqar/kde/src/utilities/kate/kate/kateconfigdialog.cpp:283:36
    #2 0x563e4b1f87f1 in KateConfigDialog::addPluginPages() /home/waqar/kde/src/utilities/kate/kate/kateconfigdialog.cpp:251:13
    #3 0x563e4b1f1507 in KateConfigDialog::KateConfigDialog(KateMainWindow*) /home/waqar/kde/src/utilities/kate/kate/kateconfigdialog.cpp:54:5
    #4 0x563e4b03edf1 in KateMainWindow::showPluginConfigPage(KTextEditor::Plugin*, int) /home/waqar/kde/src/utilities/kate/kate/katemainwindow.cpp:892:33
    #5 0x563e4b0547da in KateMainWindow::slotConfigure() /home/waqar/kde/src/utilities/kate/kate/katemainwindow.cpp:883:5
    #6 0x563e4b186652 in KateMainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/waqar/kde/build/utilities/kate/kate/kate-lib_autogen/EWIEGA46WW/moc_katemainwindow.cpp:409:22
    #7 0x7fac858e09cf  (/usr/lib/libQt5Core.so.5+0x2ed9cf)
    #8 0x7fac86553f72 in QAction::triggered(bool) (/usr/lib/libQt5Widgets.so.5+0x153f72)

Signed-off-by: Waqar Ahmed waqar.17a@gmail.com

Merge request reports