mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 07:43:23 +00:00
Cleanup: don't leak filename on picture creation
dive_create_picture() is called from DiveListView::matchImagesToDives() with a copy of the picture-filename. But: - On error the filename is not freed - On success the filename is strdup()ed Thus, in all cases the memory is lost. Instead, pass in a temporary buffer using qPrintable(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b75081cc59
commit
779e33be5d
1 changed files with 1 additions and 1 deletions
|
@ -975,7 +975,7 @@ void DiveListView::matchImagesToDives(QStringList fileNames)
|
|||
for_each_dive (j, dive) {
|
||||
if (!dive->selected)
|
||||
continue;
|
||||
dive_create_picture(dive, copy_qstring(fileName), shiftDialog.amount(), shiftDialog.matchAll());
|
||||
dive_create_picture(dive, qPrintable(fileName), shiftDialog.amount(), shiftDialog.matchAll());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue