diff options
Diffstat (limited to 'libX11/modules/im/ximcp/imRmAttr.c')
-rw-r--r-- | libX11/modules/im/ximcp/imRmAttr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libX11/modules/im/ximcp/imRmAttr.c b/libX11/modules/im/ximcp/imRmAttr.c index 7503905b2..27dcbc9cd 100644 --- a/libX11/modules/im/ximcp/imRmAttr.c +++ b/libX11/modules/im/ximcp/imRmAttr.c @@ -1433,8 +1433,10 @@ _XimGetAttributeID( bzero((char *)res, res_len); values_len = sizeof(XIMValuesList) + (sizeof(char **) * n) + names_len; - if (!(tmp = (XPointer)Xmalloc(values_len))) + if (!(tmp = (XPointer)Xmalloc(values_len))) { + Xfree(res); return False; + } bzero(tmp, values_len); values_list = (XIMValuesList *)tmp; @@ -1480,8 +1482,10 @@ _XimGetAttributeID( bzero((char *)res, res_len); values_len = sizeof(XIMValuesList) + (sizeof(char **) * n) + names_len; - if (!(tmp = (XPointer)Xmalloc(values_len))) + if (!(tmp = (XPointer)Xmalloc(values_len))) { + Xfree(res); return False; + } bzero(tmp, values_len); values_list = (XIMValuesList *)tmp; |