mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-01 16:07:57 +02:00
[perf] Fix use-after-free when retrieving error line number
We find out the status on destroying the script and then attempt to query the defunct script for more info about the error. Wrong.
This commit is contained in:
parent
7c160dea54
commit
8f4611a94b
1 changed files with 2 additions and 3 deletions
|
|
@ -254,6 +254,7 @@ execute (cairo_perf_t *perf,
|
|||
for (i = 0; i < perf->iterations && ! user_interrupt; i++) {
|
||||
cairo_script_interpreter_t *csi;
|
||||
cairo_status_t status;
|
||||
unsigned int line_no;
|
||||
|
||||
csi = cairo_script_interpreter_create ();
|
||||
cairo_script_interpreter_install_hooks (csi, &hooks);
|
||||
|
|
@ -268,12 +269,10 @@ execute (cairo_perf_t *perf,
|
|||
times[i] = cairo_perf_timer_elapsed ();
|
||||
|
||||
cairo_script_interpreter_finish (csi);
|
||||
line_no = cairo_script_interpreter_get_line_number (csi);
|
||||
status = cairo_script_interpreter_destroy (csi);
|
||||
if (status) {
|
||||
if (perf->summary) {
|
||||
unsigned int line_no;
|
||||
|
||||
line_no = cairo_script_interpreter_get_line_number (csi);
|
||||
fprintf (perf->summary, "Error during replay, line %d: %s\n",
|
||||
line_no,
|
||||
cairo_status_to_string (status));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue