From 48c2929f480b74f50d97ea6790161e2a5446929d Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Mon, 19 Jul 2021 07:34:29 +0300 Subject: Fix coverity reported memory leaks Signed-off-by: Miika Turkia --- core/uploadDiveLogsDE.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/uploadDiveLogsDE.cpp b/core/uploadDiveLogsDE.cpp index a2914c406..6dc764ed1 100644 --- a/core/uploadDiveLogsDE.cpp +++ b/core/uploadDiveLogsDE.cpp @@ -104,8 +104,10 @@ bool uploadDiveLogsDE::prepareDives(const QString &tempfile, bool selected) * Get the i'th dive in XML format so we can process it. * We need to save to a file before we can reload it back into memory... */ - if (selected && !dive->selected) + if (selected && !dive->selected) { + free_xml_params(params); continue; + } /* make sure the buffer is empty and add the dive */ mb.len = 0; @@ -151,6 +153,7 @@ bool uploadDiveLogsDE::prepareDives(const QString &tempfile, bool selected) zip_close(zip); QFile::remove(tempfile); xsltFreeStylesheet(xslt); + free_xml_params(params); return false; } free_buffer(&mb); -- cgit v1.2.3-70-g09d2