[gnc-report.cpp] Refinement to 1da2464577 -- *errmsg must be assigned

Callers to this function expect that either *data or *errmsg are
assigned a newly allocated char, to be g_freed later.
This commit is contained in:
Christopher Lam 2023-12-21 22:05:11 +08:00
parent cac01aae65
commit 5bcf979f0b

View File

@ -227,18 +227,12 @@ gnc_run_report_with_error_handling (gint report_id, gchar ** data, gchar **errms
*errmsg = NULL;
return TRUE;
}
else if (scm_is_string (captured_error))
{
*errmsg = gnc_scm_to_utf8_string (captured_error);
*data = NULL;
PWARN ("Error in report: %s", *errmsg);
return FALSE;
}
else
{
*errmsg = scm_is_string (captured_error) ? gnc_scm_to_utf8_string (captured_error) :
g_strdup ("");
*data = nullptr;
PWARN("Report %s Failed to generate html but didn't raise a Scheme exception.",
gnc_report_name (report));
PWARN ("Error in report: %s", *errmsg);
return FALSE;
}
}