diff options
author | Hidetoshi Tajima <tajima@src.gnome.org> | 2002-11-26 22:13:50 +0000 |
---|---|---|
committer | Hidetoshi Tajima <tajima@src.gnome.org> | 2002-11-26 22:13:50 +0000 |
commit | 60207c37621eb8670aff6817a0c90dd24fd7bc60 (patch) | |
tree | 7d48a40aaf905e3e7ac650f8100c7d32fa437842 /modules | |
parent | b9c08f5e9ab05c4fb9584fe73f99b82918ae801d (diff) | |
download | gtk+-60207c37621eb8670aff6817a0c90dd24fd7bc60.tar.gz |
Fix #99593: Fix a memory leak when XmbLookupString returns XBufferOverflow
* modules/input/gtkimcontextxim.c
(gtk_im_context_xim_filter_keypress):
Fix #99593: Fix a memory leak when XmbLookupString returns
XBufferOverflow
Diffstat (limited to 'modules')
-rw-r--r-- | modules/input/gtkimcontextxim.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/input/gtkimcontextxim.c b/modules/input/gtkimcontextxim.c index 5b76f8357e..680a6396a9 100644 --- a/modules/input/gtkimcontextxim.c +++ b/modules/input/gtkimcontextxim.c @@ -560,6 +560,8 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context, if (status == XBufferOverflow) { buffer_size = num_bytes; + if (buffer != static_buffer) + g_free (buffer); buffer = g_malloc (num_bytes + 1); goto again; } @@ -590,6 +592,9 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context, } } + if (buffer != static_buffer) + g_free (buffer); + return result; } |