https://bugs.kde.org/show_bug.cgi?id=523955

            Bug ID: 523955
           Summary: SambaUserSharePlugin leaks m_permissionsHelper
    Classification: Frameworks and Libraries
           Product: kdenetwork-filesharing
      Version First unspecified
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

DESCRIPTION
While using AddressSanitizer to find memory leaks with my rom-properties shell
extension, I noticed the following leak in SambaUserSharePlugin:

Indirect leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7f4a91d291ef in operator new(unsigned long)
/var/tmp/portage/sys-devel/gcc-16.1.1_p20260613/work/gcc-16-20260613/libsanitizer/asan/asan_new_delete.cpp:109
    #1 0x7b4a7be7d4ca in SambaUserSharePlugin::SambaUserSharePlugin(QObject*)
/var/tmp/portage/kde-apps/kdenetwork-filesharing-26.04.2/work/kdenetwork-filesharing-26.04.2/samba/filepropertiesplugin/sambausershareplugin.cpp:97
    #2 0x7b4a7be7dd9c in QObject*
KPluginFactory::createInstance<SambaUserSharePlugin, QObject>(QWidget*,
QObject*, KPluginMetaData const&, QList<QVariant> const&)
/usr/include/KF6/KCoreAddons/kpluginfactory.h:642
    #3 0x7b4a8e89101a in KPropertiesDialogPrivate::insertPages()
/var/tmp/portage/kde-frameworks/kio-6.28.0/work/kio-6.28.0/src/widgets/kpropertiesdialog.cpp:557
    #4 0x7b4a8e8923cc in KPropertiesDialogPrivate::init()
/var/tmp/portage/kde-frameworks/kio-6.28.0/work/kio-6.28.0/src/widgets/kpropertiesdialog.cpp:336
    #5 0x7b4a8c0ef610 in rp_show_RomDataView_dialog
src/kde/config/stub-export.cpp:234

In sambausershareplugin.cpp on line 97, m_permissionsHelper is created without
a parent object specified, and it's never deleted. The end result is
m_permissionsHelper is leaked after the SambaUserSharePlugin is deleted.

STEPS TO REPRODUCE
1. Open file properties with ASan enabled.

OBSERVED RESULT
SambaUserSharePlugin leaks m_permissionsHelper.

EXPECTED RESULT
m_permissionsHelper is deleted when it's no longer needed.

SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a
terminal window):
KDE Plasma Version: 6.7.4
KDE Frameworks Version: 6.28.0
Qt Version: 6.11.1

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to