From 652e382e686df5fe0e63e2f2568e820819ab1b08 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 26 Dec 2017 13:14:40 -0800 Subject: Cleanup: avoid a few memory leaks Coverity CID 215199 Coverity CID 215195 Coverity CID 215196 Coverity CID 215198 Signed-off-by: Dirk Hohndel --- core/ostctools.c | 1 + qt-models/diveplannermodel.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/ostctools.c b/core/ostctools.c index 48c86a378..fbee65b2f 100644 --- a/core/ostctools.c +++ b/core/ostctools.c @@ -177,6 +177,7 @@ void ostctools_import(const char *file, struct dive_table *divetable) sort_table(divetable); fclose(archive); out: + free(archive); free(devdata); free(buffer); } diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 1d3e3347e..8efb3473c 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -1019,7 +1019,7 @@ void DivePlannerPointsModel::computeVariations(struct diveplan *original_plan, s if (in_planner() && prefs.display_variations && decoMode() != RECREATIONAL) { int my_instance = ++instanceCounter; cache_deco_state(&ds, &save); - + duration_t delta_time = { .seconds = 60 }; QString time_units = tr("min"); depth_t delta_depth; @@ -1089,6 +1089,9 @@ void DivePlannerPointsModel::computeVariations(struct diveplan *original_plan, s finish: free_dps(original_plan); free(original_plan); + free(save); + free(cache); + free(dive); // setRecalc(oldRecalc); } -- cgit v1.2.3-70-g09d2