Skip to content

Commit

Permalink
[gnc-report.cpp] Refinement to 1da2464 -- *errmsg must be assigned
Browse files Browse the repository at this point in the history
Callers to this function expect that either *data or *errmsg are
assigned a newly allocated char, to be g_freed later.
  • Loading branch information
christopherlam committed Dec 21, 2023
1 parent cac01aa commit 5bcf979
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions gnucash/report/gnc-report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 5bcf979

Please sign in to comment.