ea4k / klog

KLog is a multiplatform free hamradio logger. It runs natively on Linux, macOS and Windows.
https://www.klog.xyz
GNU General Public License v3.0
75 stars 25 forks source link

Bug: multiple double frees of DataProxy_SQLite #727

Open ikbenkous opened 3 months ago

ikbenkous commented 3 months ago

FileAwardManager in its constructor takes a DataProxy_SQLite pointer from outside. This pointer is then internally deleted. This causes a segmentation fault. This has to be a double free, right?!

From a cursory reading, I recommend upgrading DataProxy_SQLite* to a std::shared_ptr<DataProxy_SQLite> object. I don't know if that makes sense at all.

ikbenkous commented 3 months ago

It seems a variable called dataProxy gets deleted in a lot of places. Are all of these duplicate frees?

charts/statscqzperyearbarchartwidget.cpp:    delete(dataProxy);
charts/statsentitiesperyearbarchartwidget.cpp:    delete(dataProxy);
charts/statsfieldperbandwidget.cpp:    delete(dataProxy);
charts/statsgridsonsatswidget.cpp:    delete(dataProxy);
charts/statsqsosperbandbarchartwidget.cpp:    delete(dataProxy);
charts/statsqsospercontinentbarchartwidget.cpp:    delete(dataProxy);
charts/statsqsosperdxccbarchartwidget.cpp:    delete(dataProxy);
charts/statsqsosperhourbarchartwidget.cpp:    delete(dataProxy);
charts/statsqsospermodebarchartwidget.cpp:    delete(dataProxy);
charts/statsqsospermonthbarchartwidget.cpp:    delete(dataProxy);
charts/statsqsosperyearbarchartwidget.cpp:    delete(dataProxy);
charts/statssentconfirmedpiechartwidget.cpp:    delete(dataProxy);
charts/statsworkedconfirmedpiechartwidget.cpp:    delete(dataProxy);
charts/statsworkedsentpiechartwidget.cpp:    delete(dataProxy);
dxcluster/dxcluster.cpp:    delete(dataProxy);
fileawardmanager.cpp:    //delete(dataProxy);
inputwidgets/mainwindowinputeqsl.cpp:    delete(dataProxy);
inputwidgets/mainwindowinputqso.cpp:    delete(dataProxy);
inputwidgets/mainwindowmydatatab.cpp:    delete(dataProxy);
inputwidgets/mainwindowsattab.cpp:    delete(dataProxy);
lotwutilities.cpp:    delete(dataProxy);
searchmodel.cpp:    delete(dataProxy);
searchwidget.cpp:    delete(dataProxy);
searchwindow.cpp:    delete(dataProxy);
setuppages/setuppagesatsnew.cpp:    delete(dataProxy);
setuppages/setuppagesubdivisionnew.cpp:    delete(dataProxy);
setuppages/setuppageuserdata.cpp:    delete(dataProxy);
widgets/map/mapwindowwidget.cpp:    delete(dataProxy);