]> git.cworth.org Git - apitrace/blobdiff - common/trace_parser.cpp
Delete the file object if the trace file could not be loaded due to being an unsuppor...
[apitrace] / common / trace_parser.cpp
index f7a1f78e54b1e0f511a78bc8ee49a17ef51b153b..a9cdd0fbc0586465be407522a0148146e05f283a 100644 (file)
@@ -65,6 +65,8 @@ bool Parser::open(const char *filename) {
     version = read_uint();
     if (version > TRACE_VERSION) {
         std::cerr << "error: unsupported trace format version " << version << "\n";
+        delete file;
+        file = NULL;
         return false;
     }
     api = API_UNKNOWN;