gerror: Don't leak when warning about overwriting an error

While not strictly necessary, this fixes a false positive
leak in the tests.

https://bugzilla.gnome.org/show_bug.cgi?id=627423
This commit is contained in:
Stef Walter 2013-10-31 14:39:05 +01:00
parent 92b71825fd
commit 2672228733

View File

@ -587,16 +587,13 @@ g_set_error_literal (GError **err,
gint code,
const gchar *message)
{
GError *new;
if (err == NULL)
return;
new = g_error_new_literal (domain, code, message);
if (*err == NULL)
*err = new;
*err = g_error_new_literal (domain, code, message);
else
g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
g_warning (ERROR_OVERWRITTEN_WARNING, message);
}
/**