Whoops, was freeing the same memory twice.

This commit is contained in:
WrinklyNinja
2014-06-23 11:01:07 +01:00
parent e88a0915be
commit b06b51a011
-10
View File
@@ -46,10 +46,6 @@ namespace loot {
git_handler() : repo(nullptr), remote(nullptr), cfg(nullptr), obj(nullptr), commit(nullptr), ref(nullptr), sig(nullptr), blob(nullptr) {}
~git_handler() {
free();
}
void free() {
git_commit_free(commit);
git_object_free(obj);
git_config_free(cfg);
@@ -70,7 +66,6 @@ namespace loot {
error_message = to_string(error_code) + ".";
else
error_message = to_string(error_code) + "; " + last_error->message;
free();
giterr_clear();
if (ui_message.empty())
@@ -172,11 +167,9 @@ namespace loot {
out << boost::locale::as::ftime("%Y-%m-%d") << dateTime;
date = out.str();
git.free();
return pair<string, string>(revision, date);
}
else {
git.free();
return pair<string, string>("Unknown: Masterlist edited", "Unknown: Masterlist edited");
}
}
@@ -345,9 +338,6 @@ namespace loot {
}
} while (parsingFailed);
//Finally, free memory.
git.free();
return pair<string, string>(revision, date);
}
}