[mutter/wip/carlosg/coverity-fixes: 7/13] cogl: Plug GString leak
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/coverity-fixes: 7/13] cogl: Plug GString leak
- Date: Mon, 25 Oct 2021 09:17:23 +0000 (UTC)
commit c50e1d3e7b8ff364885a469752db545b9e6bd9f0
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Oct 24 22:56:38 2021 +0200
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
cogl/cogl/cogl-renderer.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/cogl/cogl/cogl-renderer.c b/cogl/cogl/cogl-renderer.c
index d815757a0c..5b37d8634d 100644
--- a/cogl/cogl/cogl-renderer.c
+++ b/cogl/cogl/cogl-renderer.c
@@ -529,7 +529,7 @@ gboolean
cogl_renderer_connect (CoglRenderer *renderer, GError **error)
{
int i;
- GString *error_message;
+ g_autoptr (GString) error_message = NULL;
gboolean constraints_failed = FALSE;
if (renderer->connected)
@@ -594,7 +594,6 @@ cogl_renderer_connect (CoglRenderer *renderer, GError **error)
else
{
renderer->connected = TRUE;
- g_string_free (error_message, 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,
"Failed to connected to any renderer: %s",
error_message->str);
- g_string_free (error_message, TRUE);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]