Even though we can't always make no-leak guarantees when g_warning()
in this case we're testing this behavior in tests, and it would be
good to be able to valgrind this.
https://bugzilla.gnome.org/show_bug.cgi?id=711751
if (*err == NULL)
*err = new;
else
- g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
+ {
+ g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
+ g_error_free (new);
+ }
}
/**
else
{
if (*dest != NULL)
- g_warning (ERROR_OVERWRITTEN_WARNING, src->message);
+ {
+ g_warning (ERROR_OVERWRITTEN_WARNING, src->message);
+ g_error_free (src);
+ }
else
*dest = src;
}
g_test_assert_expected_messages ();
g_assert_error (dest, G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY);
- g_assert_error (src, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE);
g_error_free (dest);
- g_error_free (src);
-
}
static void