diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2021-07-19 07:34:29 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-07-19 09:07:48 -0700 |
commit | 48c2929f480b74f50d97ea6790161e2a5446929d (patch) | |
tree | 4259498b80d8381ed860daba0b5e265a470f3e6d | |
parent | 63795a84f4e54dc5cf1bfa1d685dea685f85d424 (diff) | |
download | subsurface-48c2929f480b74f50d97ea6790161e2a5446929d.tar.gz |
Fix coverity reported memory leaks
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
-rw-r--r-- | core/uploadDiveLogsDE.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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); |