Fix mem leak in sets_translate example. (#2589)
authorAina Niemetz <aina.niemetz@gmail.com>
Thu, 4 Oct 2018 05:35:59 +0000 (22:35 -0700)
committerGitHub <noreply@github.com>
Thu, 4 Oct 2018 05:35:59 +0000 (22:35 -0700)
examples/sets-translate/sets_translate.cpp

index 452a874a8ceebab02af1f8fa734885d1312b0c34..7a1990545c8d5d315f804ac7af56be4f05cad911 100644 (file)
@@ -277,7 +277,8 @@ int main(int argc, char* argv[])
     // Create the parser
     ParserBuilder parserBuilder(solver.get(), input, options);
     if(input == "<stdin>") parserBuilder.withStreamInput(cin);
-    Parser* parser = parserBuilder.build();
+    std::unique_ptr<Parser> parser;
+    parser.reset(parserBuilder.build());
 
     // Variables and assertions
     vector<string> variables;