Plug some leaks in TestController and UIScriptContext.
[WebKit-https.git] / Tools / TestRunnerShared / UIScriptContext / UIScriptContext.cpp
index 7f3896d..cc91d44 100644 (file)
@@ -67,7 +67,8 @@ void UIScriptContext::runUIScript(const String& script, unsigned scriptCallbackI
     
     if (!hasOutstandingAsyncTasks()) {
         JSValueRef stringifyException = nullptr;
-        requestUIScriptCompletion(JSValueToStringCopy(m_context.get(), result, &stringifyException));
+        JSRetainPtr<JSStringRef> stringified(Adopt, JSValueToStringCopy(m_context.get(), result, &stringifyException));
+        requestUIScriptCompletion(stringified.get());
         tryToCompleteUIScriptForCurrentParentCallback();
     }
 }