1
0
Fork 0

fixed leak

This commit is contained in:
jsteemann 2016-02-07 00:06:38 +01:00
parent 546ffce3ed
commit d2001b6c0a
1 changed files with 2 additions and 1 deletions

View File

@ -1613,6 +1613,8 @@ static void JS_Load(v8::FunctionCallbackInfo<v8::Value> const& args) {
TRI_V8_PAIR_STRING(content, length), TRI_V8_PAIR_STRING(content, length),
filename->ToString(), false); filename->ToString(), false);
TRI_FreeString(TRI_UNKNOWN_MEM_ZONE, content);
// restore old values for __dirname and __filename // restore old values for __dirname and __filename
if (oldFilename.IsEmpty() || oldFilename->IsUndefined()) { if (oldFilename.IsEmpty() || oldFilename->IsUndefined()) {
current->Delete(TRI_V8_ASCII_STRING("__filename")); current->Delete(TRI_V8_ASCII_STRING("__filename"));
@ -1636,7 +1638,6 @@ static void JS_Load(v8::FunctionCallbackInfo<v8::Value> const& args) {
} }
} }
TRI_FreeString(TRI_UNKNOWN_MEM_ZONE, content);
TRI_V8_RETURN(result); TRI_V8_RETURN(result);
TRI_V8_TRY_CATCH_END TRI_V8_TRY_CATCH_END
} }