From 7869ffbb49cf99fcf7c4a7f1b4925262991d1e5d Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Sun, 24 Jun 2018 15:49:46 -0500 Subject: imwayland: Fix a small leak If the parent get_preedit_string implementation returns a nonnull zero-length string, then we ignore it, which is almost fine. We have to free it, though. Fixes #1174 --- gtk/gtkimcontextwayland.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gtk/gtkimcontextwayland.c') diff --git a/gtk/gtkimcontextwayland.c b/gtk/gtkimcontextwayland.c index e9cc6a6eb2..141ad6c6c9 100644 --- a/gtk/gtkimcontextwayland.c +++ b/gtk/gtkimcontextwayland.c @@ -472,8 +472,13 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context, GTK_IM_CONTEXT_CLASS (gtk_im_context_wayland_parent_class)->get_preedit_string (context, str, attrs, cursor_pos); /* If the parent implementation returns a len>0 string, go with it */ - if (str && *str && **str) - return; + if (str && *str) + { + if (**str) + return; + + g_free (*str); + } preedit_str = context_wayland->preedit.text ? context_wayland->preedit.text : ""; -- cgit v1.2.1