From dd38b88cc2c182a612d1e10d9433b965d6d6357d Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 22 Aug 2021 12:22:50 +0200 Subject: [PATCH] libgimpwidgets: free leaked GError. Thanks to Massimo for reporting. --- libgimpwidgets/gimpeevl.c | 2 +- libgimpwidgets/gimpsizeentry.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libgimpwidgets/gimpeevl.c b/libgimpwidgets/gimpeevl.c index 55bf3232bb..a643bc097e 100644 --- a/libgimpwidgets/gimpeevl.c +++ b/libgimpwidgets/gimpeevl.c @@ -162,7 +162,7 @@ static void gimp_eevl_error (GimpEevl * @result: Result of evaluation. * @error_pos: Will point to the position within the string, * before which the parse / evaluation error - * occurred. Will be set to null of no error occurred. + * occurred. Will be set to null if no error occurred. * @error_message: Will point to a static string with a semi-descriptive * error message if parsing / evaluation failed. * diff --git a/libgimpwidgets/gimpsizeentry.c b/libgimpwidgets/gimpsizeentry.c index 4f10cb6bf8..28333dea59 100644 --- a/libgimpwidgets/gimpsizeentry.c +++ b/libgimpwidgets/gimpsizeentry.c @@ -1366,7 +1366,7 @@ gimp_size_entry_eevl_input_callback (GtkSpinButton *spinner, GimpSizeEntryPrivate *priv = GET_PRIVATE (gsef->gse); GimpEevlOptions options = GIMP_EEVL_OPTIONS_INIT; gboolean success = FALSE; - const gchar *error_pos = 0; + const gchar *error_pos = NULL; GError *error = NULL; GimpEevlQuantity result; @@ -1424,6 +1424,7 @@ gimp_size_entry_eevl_input_callback (GtkSpinButton *spinner, { g_printerr ("ERROR: Expression evaluation failed without error.\n"); } + g_clear_error (&error); gtk_widget_error_bell (GTK_WIDGET (spinner)); return GTK_INPUT_ERROR;