[gnome-builder/gnome-builder-3-18] libide: plug (impossible) leak to quiet warnings
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-18] libide: plug (impossible) leak to quiet warnings
- Date: Tue, 13 Oct 2015 07:35:06 +0000 (UTC)
commit f668447508e083d78505077bcdc5920d7e82dafe
Author: Christian Hergert <christian hergert me>
Date: Sat Oct 3 15:53:52 2015 -0700
libide: plug (impossible) leak to quiet warnings
libide/ide-source-view.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index db86525..72d80eb 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -4502,22 +4502,22 @@ ide_source_view_get_fixit_label (IdeSourceView *self,
gchar *old_text = NULL;
gchar *new_text = NULL;
gchar *tmp;
- gchar *ret;
+ gchar *ret = NULL;
g_assert (IDE_IS_SOURCE_VIEW (self));
g_assert (fixit != NULL);
range = ide_fixit_get_range (fixit);
if (range == NULL)
- return NULL;
+ goto cleanup;
new_text = g_strdup (ide_fixit_get_text (fixit));
if (new_text == NULL)
- return NULL;
+ goto cleanup;
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self));
if (!IDE_IS_BUFFER (buffer))
- return NULL;
+ goto cleanup;
begin_loc = ide_source_range_get_begin (range);
end_loc = ide_source_range_get_end (range);
@@ -4554,6 +4554,7 @@ ide_source_view_get_fixit_label (IdeSourceView *self,
else
ret = g_strdup_printf (_("Replace \"%s\" with \"%s\""), old_text, new_text);
+cleanup:
g_free (old_text);
g_free (new_text);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]