mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 10:08:56 +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:
		@@ -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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user