diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 7926965302161c..34dbdf08420329 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -764,8 +764,8 @@ void ContextifyScript::New(const FunctionCallbackInfo& args) { env->cached_data_rejected_string(), Boolean::New(isolate, source.GetCachedData()->rejected)).Check(); } else if (produce_cached_data) { - const ScriptCompiler::CachedData* cached_data = - ScriptCompiler::CreateCodeCache(v8_script.ToLocalChecked()); + std::unique_ptr cached_data { + ScriptCompiler::CreateCodeCache(v8_script.ToLocalChecked()) }; bool cached_data_produced = cached_data != nullptr; if (cached_data_produced) { MaybeLocal buf = Buffer::Copy(