Fixed memory leaks in non-gui tests

Fixed 2 memory leaks in production code and a few in testcases. As a
result leak_check_at_exit ASAN option does not need to turned off for
non-gui tests.
Smart pointers should be used elsewhere for consistency, but the sooner
this fixes are delivered, the lesser memory leaks are introduced.
This commit is contained in:
Michal Kaptur
2017-11-27 21:41:58 +01:00
committed by Janek Bevendorff
parent b20918b60e
commit 0ff75e7a88
10 changed files with 125 additions and 167 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016 Felix Geyer <debfx@fobos.de>
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +21,7 @@
#include <QCoreApplication>
#include <QIODevice>
#include <QPair>
#include "core/Database.h"
#include "keys/CompositeKey.h"
@@ -36,14 +38,12 @@ public:
RepairSuccess,
RepairFailed
};
using RepairOutcome = QPair<RepairResult, Database*>;
KeePass2Repair();
RepairResult repairDatabase(QIODevice* device, const CompositeKey& key);
Database* database() const;
RepairOutcome repairDatabase(QIODevice* device, const CompositeKey& key);
QString errorString() const;
private:
Database* m_db;
QString m_errorStr;
};