summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoobrowse-api/service/utils/git.cpp4
-rw-r--r--gentoobrowse-api/unittests/testUtils.cpp6
2 files changed, 9 insertions, 1 deletions
diff --git a/gentoobrowse-api/service/utils/git.cpp b/gentoobrowse-api/service/utils/git.cpp
index 52c31d1..6e2e04e 100644
--- a/gentoobrowse-api/service/utils/git.cpp
+++ b/gentoobrowse-api/service/utils/git.cpp
@@ -13,7 +13,9 @@ namespace Gentoo {
char ** fn = backtrace_symbols(&func, 1);
assert(fn);
assert(*fn);
- throw ::Gentoo::GitError(*fn, err, e->klass, e->message);
+ std::string funcName(*fn);
+ free(fn);
+ throw ::Gentoo::GitError(funcName, err, e->klass, e->message);
}
std::string
diff --git a/gentoobrowse-api/unittests/testUtils.cpp b/gentoobrowse-api/unittests/testUtils.cpp
index e89f0fb..5109d48 100644
--- a/gentoobrowse-api/unittests/testUtils.cpp
+++ b/gentoobrowse-api/unittests/testUtils.cpp
@@ -2,12 +2,15 @@
#include <boost/test/unit_test.hpp>
#include <utils/git.h>
+#include <libxml/parser.h>
#include <maintenance.h>
using namespace Gentoo::Utils::Git;
BOOST_AUTO_TEST_CASE( gitErrorMessage )
{
+ xmlInitParser();
+
try {
gitSafeGet(git_repository_open_ext, git_repository_free, "/", 0, nullptr);
}
@@ -19,5 +22,8 @@ BOOST_AUTO_TEST_CASE( gitErrorMessage )
BOOST_REQUIRE(ge.message.find("repository") + 1);
}
}
+
+ xmlCleanupParser();
+ git_libgit2_shutdown();
}