[vm] Ensure `error` out-parameter is cleared

This fixes a regression introduced in [0] that removed clearing of the
error out-parameter.

[0] https://dart-review.googlesource.com/c/sdk/+/306134

TEST=Fixes `free(<invalid-pointer>)` test failures.

Change-Id: Id2db1458128c3b5cb3b37e4327ba71ff81100f15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306604
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
diff --git a/runtime/bin/dartdev_isolate.cc b/runtime/bin/dartdev_isolate.cc
index 0457f21..2c45073 100644
--- a/runtime/bin/dartdev_isolate.cc
+++ b/runtime/bin/dartdev_isolate.cc
@@ -221,7 +221,7 @@
   flags.is_system_isolate = true;
   flags.branch_coverage = false;
 
-  char* error;
+  char* error = nullptr;
   Dart_Isolate dartdev_isolate = runner->create_isolate_(
       DART_DEV_ISOLATE_NAME, DART_DEV_ISOLATE_NAME, nullptr,
       runner->packages_file_, &flags, /* callback_data */ nullptr,
diff --git a/runtime/bin/main_impl.cc b/runtime/bin/main_impl.cc
index eecebd8..f515da6 100644
--- a/runtime/bin/main_impl.cc
+++ b/runtime/bin/main_impl.cc
@@ -844,6 +844,10 @@
   ASSERT(flags->version == DART_FLAGS_CURRENT_VERSION);
   ASSERT(package_root == nullptr);
 
+  if (error != nullptr) {
+    *error = nullptr;
+  }
+
   bool dontneed_safe = true;
 #if defined(DART_HOST_OS_LINUX)
   // This would also be true in Linux, except that Google3 overrides the default