mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
cogl: Plug GString leak
In some error paths, this string was being leaked. Make it g_autoptr so it's done for us. CID: #1505903 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2061>
This commit is contained in:
parent
b3046cca2d
commit
4dc07999c6
@ -529,7 +529,7 @@ gboolean
|
|||||||
cogl_renderer_connect (CoglRenderer *renderer, GError **error)
|
cogl_renderer_connect (CoglRenderer *renderer, GError **error)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
GString *error_message;
|
g_autoptr (GString) error_message = NULL;
|
||||||
gboolean constraints_failed = FALSE;
|
gboolean constraints_failed = FALSE;
|
||||||
|
|
||||||
if (renderer->connected)
|
if (renderer->connected)
|
||||||
@ -594,7 +594,6 @@ cogl_renderer_connect (CoglRenderer *renderer, GError **error)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
renderer->connected = TRUE;
|
renderer->connected = TRUE;
|
||||||
g_string_free (error_message, TRUE);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -613,7 +612,6 @@ cogl_renderer_connect (CoglRenderer *renderer, GError **error)
|
|||||||
g_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_INIT,
|
g_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_INIT,
|
||||||
"Failed to connected to any renderer: %s",
|
"Failed to connected to any renderer: %s",
|
||||||
error_message->str);
|
error_message->str);
|
||||||
g_string_free (error_message, TRUE);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user