core: Fix a recently introduced use after free.
This commit is contained in:
@@ -367,10 +367,10 @@ static JSValue _httpd_app_on_process_start(JSContext* context, JSValueConst this
|
|||||||
JSValue process_app = JS_GetPropertyStr(context, app->process, "app");
|
JSValue process_app = JS_GetPropertyStr(context, app->process, "app");
|
||||||
JSValue on_output = JS_NewCFunctionData(context, _httpd_app_on_output, 1, 0, 1, func_data);
|
JSValue on_output = JS_NewCFunctionData(context, _httpd_app_on_output, 1, 0, 1, func_data);
|
||||||
JS_SetPropertyStr(context, process_app, "_on_output", on_output);
|
JS_SetPropertyStr(context, process_app, "_on_output", on_output);
|
||||||
JS_FreeValue(context, process_app);
|
|
||||||
|
|
||||||
JSValue send = JS_GetPropertyStr(context, process_app, "send");
|
JSValue send = JS_GetPropertyStr(context, process_app, "send");
|
||||||
JSValue result = JS_Call(context, send, process_app, 0, NULL);
|
JSValue result = JS_Call(context, send, process_app, 0, NULL);
|
||||||
|
JS_FreeValue(context, process_app);
|
||||||
JS_FreeValue(context, send);
|
JS_FreeValue(context, send);
|
||||||
tf_util_report_error(context, result);
|
tf_util_report_error(context, result);
|
||||||
JS_FreeValue(context, result);
|
JS_FreeValue(context, result);
|
||||||
|
|||||||
Reference in New Issue
Block a user