File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1168,14 +1168,15 @@ ExitCode LoadSnapshotDataAndRun(const SnapshotData** snapshot_data_ptr,
11681168 return exit_code;
11691169 }
11701170 std::unique_ptr<SnapshotData> read_data = std::make_unique<SnapshotData>();
1171- if (!SnapshotData::FromBlob (read_data.get (), fp)) {
1171+ bool ok = SnapshotData::FromBlob (read_data.get (), fp);
1172+ fclose (fp);
1173+ if (!ok) {
11721174 // If we fail to read the customized snapshot, simply exit with 1.
11731175 // TODO(joyeecheung): should be kStartupSnapshotFailure.
11741176 exit_code = ExitCode::kGenericUserError ;
11751177 return exit_code;
11761178 }
11771179 *snapshot_data_ptr = read_data.release ();
1178- fclose (fp);
11791180 } else if (per_process::cli_options->node_snapshot ) {
11801181 // If --snapshot-blob is not specified, we are reading the embedded
11811182 // snapshot, but we will skip it if --no-node-snapshot is specified.
You can’t perform that action at this time.
0 commit comments