Skip to content

Commit

Permalink
Merge Richard Cohen's 'fix-memory-errors' into stable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Jun 20, 2023
2 parents 7381887 + 3c0b051 commit 08d083e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bindings/engine.i
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ GLIST_HELPER_INOUT(PriceList, SWIGTYPE_p_GNCPrice);
// TODO: free PriceList?
GLIST_HELPER_INOUT(CommodityList, SWIGTYPE_p_gnc_commodity);

%typemap(newfree) gchar * "g_free($1);"
%typemap(newfree) char * "g_free($1);"

/* These need to be here so that they are *before* the function
declarations in the header files, some of which are included by
Expand Down
10 changes: 2 additions & 8 deletions libgnucash/app-utils/gnc-exp-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,10 @@ update_variables (var_store_ptr vars)
}
}

static char* _function_evaluation_error_msg = NULL;
static void
_exception_handler(const char *error_message)
{
_function_evaluation_error_msg = (char*)error_message;
PERR("function eval error: [%s]\n", error_message);
}

static
Expand Down Expand Up @@ -335,14 +334,9 @@ func_op(const char *fname, int argc, void **argv)
scmArgs = scm_cons( scmTmp, scmArgs );
}

//scmTmp = scm_apply(scmFn, scmArgs , SCM_EOL);
scmTmp = gfec_apply(scmFn, scmArgs, _exception_handler);
if (_function_evaluation_error_msg != NULL)
{
PERR("function eval error: [%s]\n", _function_evaluation_error_msg);
_function_evaluation_error_msg = NULL;
if (scmTmp == SCM_UNDEFINED)
return NULL;
}

if (!scm_is_number (scmTmp))
{
Expand Down

0 comments on commit 08d083e

Please sign in to comment.