mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
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:
parent
92b71825fd
commit
2672228733
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user