3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-08 15:13:23 +00:00

API: dont deref already free'd memory on error

This commit is contained in:
Nuno Lopes 2020-06-30 15:04:40 +01:00
parent 64f1a759a7
commit 8fda4f904d
7 changed files with 24 additions and 14 deletions

View file

@ -358,14 +358,14 @@ extern "C" {
try {
if (!parse_smt2_commands(*ctx.get(), s)) {
ctx = nullptr;
SET_ERROR_CODE(Z3_PARSER_ERROR, errstrm.str().c_str());
SET_ERROR_CODE(Z3_PARSER_ERROR, errstrm.str());
return;
}
}
catch (z3_exception& e) {
errstrm << e.msg();
ctx = nullptr;
SET_ERROR_CODE(Z3_PARSER_ERROR, errstrm.str().c_str());
SET_ERROR_CODE(Z3_PARSER_ERROR, errstrm.str());
return;
}