public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ibus] autotool: Fix memory leak in compose
@ 2026-05-31  2:09 Takao Fujiwara
  0 siblings, 0 replies; only message in thread
From: Takao Fujiwara @ 2026-05-31  2:09 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/ibus
Branch : autotool
Commit : c740599bb0d63bce19995be29e445b8520942b99
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date   : 2025-09-25T20:39:42+09:00
Stats  : +86/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/ibus/c/c740599bb0d63bce19995be29e445b8520942b99?branch=autotool

Log:
Fix memory leak in compose

---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index e69de29..7f9a6bd 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -0,0 +1,81 @@
+From abe7ed1bbe59fc89cf9a4cac5f0f4c3c6dee8cf7 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Thu, 25 Sep 2025 19:33:35 +0900
+Subject: [PATCH] src/ibuscomposetable: Fix leak with %L in compose file
+
+When IBus compose cache file is generated and the compose file
+includes "%L", a leak happens.
+Also fixes leaks in unicode-parser.
+---
+ src/ibuscomposetable.c |  3 ++-
+ src/unicode-parser.c   | 12 +++++++++++-
+ 2 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
+index 8a4b17a0..e60ad091 100644
+--- a/src/ibuscomposetable.c
++++ b/src/ibuscomposetable.c
+@@ -284,6 +284,7 @@ expand_include_path (const char *include_path) {
+                 break;
+             }
+             case 'L': /* locale compose file */
++                g_free (out);
+                 out = g_strdup ("%L");
+                 head = i + 2;
+                 while (*head || *head == ' ' || *head == '\t') head++;
+@@ -315,7 +316,7 @@ expand_include_path (const char *include_path) {
+                            "has been ignored", include_path, *(i+1));
+                 goto fail;
+             }
+-            ++i;
++            break;
+         }
+     }
+     o = out;
+diff --git a/src/unicode-parser.c b/src/unicode-parser.c
+index 8fece362..f86c1c81 100644
+--- a/src/unicode-parser.c
++++ b/src/unicode-parser.c
+@@ -141,7 +141,13 @@ ucd_names_list_parse_alias (const gchar *line,
+ 
+     if (*line == '\0')
+         return FALSE;
+-    data->alias = g_strdup (line);
++    if (data->alias) {
++        gchar *new_alias = g_strdup_printf ("%s;%s", data->alias, line);
++        g_free (data->alias);
++        data->alias = new_alias;
++    } else {
++        data->alias = g_strdup (line);
++    }
+     return TRUE;
+ }
+ 
+@@ -197,6 +203,7 @@ ucd_names_list_parse_line (const gchar *line,
+         }
+         data->code = code;
+         data->name = name;
++        g_strfreev (elements);
+     }
+     return TRUE;
+ }
+@@ -521,6 +528,7 @@ main (int argc, char *argv[])
+     if (output_names_list && names_list)
+         ibus_unicode_data_save (output_names_list, names_list);
+     g_free (output_names_list);
++    g_slist_free_full (names_list, g_object_unref);
+ 
+     if (input_blocks) {
+         ucd_parse_file (input_blocks, &blocks_list, UCD_BLOCKS);
+@@ -531,6 +539,8 @@ main (int argc, char *argv[])
+     if (output_blocks_trans && blocks_list)
+         ucd_block_translatable_save (output_blocks_trans, blocks_list);
+     g_free (output_blocks);
++    g_free (output_blocks_trans);
++    g_slist_free_full (blocks_list, g_object_unref);
+ 
+     g_free (unicode_version);
+     return 0;
+-- 
+2.50.1
+

diff --git a/ibus.spec b/ibus.spec
index fc74ed0..a07e44c 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -63,7 +63,7 @@
 Name:           ibus
 Version:        1.5.33~rc1
 # https://github.com/fedora-infra/rpmautospec/issues/101
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Intelligent Input Bus for Linux OS
 License:        LGPL-2.1-or-later
 URL:            https://github.com/ibus/%name/wiki
@@ -72,6 +72,7 @@ Source1:        https://github.com/ibus/%name/releases/download/%{source_version
 Source2:        %{name}-xinput
 Source3:        %{name}.conf.5
 # Patch0:         %%{name}-HEAD.patch
+Patch0:         %{name}-HEAD.patch
 # Under testing #1349148 #1385349 #1350291 #1406699 #1432252 #1601577
 Patch1:         %{name}-1385349-segv-bus-proxy.patch
 
@@ -638,6 +639,9 @@ dconf update || :
 %{_datadir}/installed-tests/ibus
 
 %changelog
+* Thu Sep 25 2025 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.33~rc1-3
+- Fix memory leak in compose
+
 * Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 1.5.33~rc1-2
 - Rebuilt for Python 3.14.0rc3 bytecode
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-31  2:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31  2:09 [rpms/ibus] autotool: Fix memory leak in compose Takao Fujiwara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox