summaryrefslogtreecommitdiff
path: root/gtk/gtkimcontextwayland.c
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2018-06-24 15:49:46 -0500
committerDaniel Boles <dboles.src@gmail.com>2018-06-25 22:20:09 +0100
commit7869ffbb49cf99fcf7c4a7f1b4925262991d1e5d (patch)
tree9ff584b1083d2a2412634b75f9c0ec6e9ee3adc3 /gtk/gtkimcontextwayland.c
parent2f149c378a6d558556121652bf0492e51679d5af (diff)
downloadgtk+-7869ffbb49cf99fcf7c4a7f1b4925262991d1e5d.tar.gz
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
Diffstat (limited to 'gtk/gtkimcontextwayland.c')
-rw-r--r--gtk/gtkimcontextwayland.c9
1 files changed, 7 insertions, 2 deletions
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 : "";