Add fix for resource leak
Resolves: RHEL-84775
This commit is contained in:
parent
2f0620c6ca
commit
0201fdffd6
42
0001-page-fix-resource-leak.patch
Normal file
42
0001-page-fix-resource-leak.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 2e5e9efd7e5079ba27de9ef01d6586a49baa10f2 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Hergert <chergert@redhat.com>
|
||||
Date: Wed, 26 Mar 2025 11:10:43 -0700
|
||||
Subject: [PATCH] page: fix resource leak
|
||||
|
||||
---
|
||||
src/editor-page.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/editor-page.c b/src/editor-page.c
|
||||
index 789f0eb..da9a2b3 100644
|
||||
--- a/src/editor-page.c
|
||||
+++ b/src/editor-page.c
|
||||
@@ -569,14 +569,15 @@ goto_line_entry_insert_text_cb (EditorPage *self,
|
||||
int *position,
|
||||
GtkText *entry)
|
||||
{
|
||||
+ g_autoptr(GString) str = NULL;
|
||||
const char *text;
|
||||
- GString *str;
|
||||
|
||||
g_assert (EDITOR_IS_PAGE (self));
|
||||
g_assert (position != NULL);
|
||||
g_assert (GTK_IS_TEXT (entry));
|
||||
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
+
|
||||
str = g_string_new (text);
|
||||
g_string_insert_len (str, *position, new_text, length);
|
||||
|
||||
@@ -588,7 +589,7 @@ goto_line_entry_insert_text_cb (EditorPage *self,
|
||||
continue;
|
||||
|
||||
g_signal_stop_emission_by_name (entry, "insert-text");
|
||||
- return;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.47.1
|
||||
|
||||
@ -17,6 +17,8 @@ License: GPL-3.0-or-later AND CC0-1.0
|
||||
URL: https://gitlab.gnome.org/GNOME/gnome-text-editor
|
||||
Source0: https://download.gnome.org/sources/%{name}/47/%{name}-%{tarball_version}.tar.xz
|
||||
|
||||
Patch: 0001-page-fix-resource-leak.patch
|
||||
|
||||
BuildRequires: pkgconfig(editorconfig)
|
||||
BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib2_version}
|
||||
BuildRequires: pkgconfig(gtk4) >= %{gtk4_version}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user