ball icon indicating copy to clipboard operation
ball copied to clipboard

Memory leak in DisplayProperties

Open tkemmer opened this issue 7 years ago • 0 comments

DisplayProperties::rep_ is used as a temporary for both owning (via [1]) and non-owning (via [2]) raw pointers, leaking memory in the first case.

[1] https://github.com/BALL-Project/ball/blob/4ee4f0a671a2bf58511f39df9549f732d1c9a532/source/VIEW/DIALOGS/displayProperties.C#L526 [2] https://github.com/BALL-Project/ball/blob/4ee4f0a671a2bf58511f39df9549f732d1c9a532/source/VIEW/DIALOGS/displayProperties.C#L190

Direct leak of 248 byte(s) in 1 object(s) allocated from:
    #0 0x7f44d3ac7760 in operator new(unsigned long) (/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/libasan.so.3+0xc8760)
    #1 0x7f44d2e889d8 in BALL::VIEW::DisplayProperties::createRepresentation(std::__cxx11::list<BALL::Composite*, std::allocator<BALL::Composite*> > const&, bool) /home/thomas/git/apps/ball/source/VIEW/DIALOGS/displayProperties.C:526
    #2 0x7f44d2e87372 in BALL::VIEW::DisplayProperties::onNotify(BALL::VIEW::Message*) /home/thomas/git/apps/ball/source/VIEW/DIALOGS/displayProperties.C:331
    #3 0x7f44d3107a43 in BALL::VIEW::ConnectionObject::onNotify_(BALL::VIEW::Message*) /home/thomas/git/apps/ball/source/VIEW/KERNEL/connectionObject.C:225
    #4 0x7f44d3107adf in BALL::VIEW::ConnectionObject::onNotify_(BALL::VIEW::Message*) /home/thomas/git/apps/ball/source/VIEW/KERNEL/connectionObject.C:235
    #5 0x7f44d31077b4 in BALL::VIEW::ConnectionObject::notify_(BALL::VIEW::Message*) /home/thomas/git/apps/ball/source/VIEW/KERNEL/connectionObject.C:194
    #6 0x7f44d3123191 in BALL::VIEW::MainControl::insert(BALL::Composite&, BALL::String, bool) /home/thomas/git/apps/ball/source/VIEW/KERNEL/mainControl.C:1583
    #7 0x7f44d333f20f in BALL::VIEW::MolecularStructure::buildPeptide() /home/thomas/git/apps/ball/source/VIEW/WIDGETS/molecularStructure.C:1465
    #8 0x7f44d33ebe46 in BALL::VIEW::MolecularStructure::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/thomas/git/apps/ball/build/VIEW_automoc.dir/moc_molecularStruc_2SOUKAKD3JKZIA.cpp:204
    #9 0x7f44c30675f8 in QMetaObject::activate(QObject*, int, int, void**) (/usr/lib64/libQt5Core.so.5+0x2675f8)
    #10 0x7f44c8d60131 in QAction::triggered(bool) (/usr/lib64/libQt5Widgets.so.5+0x153131)

tkemmer avatar Sep 01 '17 13:09 tkemmer