aboutsummaryrefslogtreecommitdiff
path: root/libX11/modules/im/ximcp/imRmAttr.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-27 15:56:59 +0000
committermarha <marha@users.sourceforge.net>2011-04-27 15:56:59 +0000
commit100633b3e7619842f345cb7603b0db6b5761dd11 (patch)
tree3c3af754c7e801c07263269837d6a05072ff834c /libX11/modules/im/ximcp/imRmAttr.c
parent205a4bdae76f287126db9f45a4f0ba631e3efca1 (diff)
parent96d6df5da9cddedf4931bf8e17f96e242467c661 (diff)
downloadvcxsrv-100633b3e7619842f345cb7603b0db6b5761dd11.tar.gz
vcxsrv-100633b3e7619842f345cb7603b0db6b5761dd11.tar.bz2
vcxsrv-100633b3e7619842f345cb7603b0db6b5761dd11.zip
svn merge ^/branches/released .
Diffstat (limited to 'libX11/modules/im/ximcp/imRmAttr.c')
-rw-r--r--libX11/modules/im/ximcp/imRmAttr.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libX11/modules/im/ximcp/imRmAttr.c b/libX11/modules/im/ximcp/imRmAttr.c
index 3183a6005..ac47f3bbe 100644
--- a/libX11/modules/im/ximcp/imRmAttr.c
+++ b/libX11/modules/im/ximcp/imRmAttr.c
@@ -1408,7 +1408,6 @@ _XimGetAttributeID(
{
unsigned int n;
XIMResourceList res;
- int res_len;
char *names;
int names_len;
XPointer tmp;
@@ -1426,18 +1425,15 @@ _XimGetAttributeID(
if (!(n = _XimCountNumberOfAttr(buf[0], &buf[1], &names_len)))
return False;
- res_len = sizeof(XIMResource) * n;
- if (!(res = (XIMResourceList)Xmalloc(res_len)))
+ if (!(res = Xcalloc(n, sizeof(XIMResource))))
return False;
- bzero((char *)res, res_len);
values_len = sizeof(XIMValuesList) + (sizeof(char **) * n) + names_len;
- if (!(tmp = (XPointer)Xmalloc(values_len))) {
+ if (!(tmp = Xcalloc(1, values_len))) {
Xfree(res);
return False;
}
- bzero(tmp, values_len);
values_list = (XIMValuesList *)tmp;
values = (char **)((char *)tmp + sizeof(XIMValuesList));
@@ -1475,18 +1471,15 @@ _XimGetAttributeID(
if (!(n = _XimCountNumberOfAttr(buf[0], &buf[2], &names_len)))
return False;
- res_len = sizeof(XIMResource) * n;
- if (!(res = (XIMResourceList)Xmalloc(res_len)))
+ if (!(res = Xcalloc(n, sizeof(XIMResource))))
return False;
- bzero((char *)res, res_len);
values_len = sizeof(XIMValuesList) + (sizeof(char **) * n) + names_len;
- if (!(tmp = (XPointer)Xmalloc(values_len))) {
+ if (!(tmp = Xcalloc(1, values_len))) {
Xfree(res);
return False;
}
- bzero(tmp, values_len);
values_list = (XIMValuesList *)tmp;
values = (char **)((char *)tmp + sizeof(XIMValuesList));