aboutsummaryrefslogtreecommitdiff
path: root/libX11/modules/im/ximcp/imLcLkup.c
diff options
context:
space:
mode:
Diffstat (limited to 'libX11/modules/im/ximcp/imLcLkup.c')
-rw-r--r--libX11/modules/im/ximcp/imLcLkup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libX11/modules/im/ximcp/imLcLkup.c b/libX11/modules/im/ximcp/imLcLkup.c
index b4ecdc317..3427fdd48 100644
--- a/libX11/modules/im/ximcp/imLcLkup.c
+++ b/libX11/modules/im/ximcp/imLcLkup.c
@@ -63,10 +63,11 @@ _XimLocalMbLookupString(XIC xic, XKeyEvent *ev, char *buffer, int bytes,
||(ic->private.local.brl_committed != 0))) {
if (ic->private.local.brl_committed != 0) { /* Braille Event */
unsigned char pattern = ic->private.local.brl_committed;
- char mb[XLC_PUBLIC(ic->core.im->core.lcd, mb_cur_max)];
+ char *mb=malloc(XLC_PUBLIC(ic->core.im->core.lcd, mb_cur_max));
ret = _Xlcwctomb(ic->core.im->core.lcd, mb, BRL_UC_ROW | pattern);
if(ret > bytes) {
if(status) *status = XBufferOverflow;
+ free(mb);
return(ret);
}
if(keysym) {
@@ -75,6 +76,7 @@ _XimLocalMbLookupString(XIC xic, XKeyEvent *ev, char *buffer, int bytes,
} else
if(status) *status = XLookupChars;
memcpy(buffer, mb, ret);
+ free(mb);
} else { /* Composed Event */
ret = strlen(&mb[b[ic->private.local.composed].mb]);
if(ret > bytes) {