aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/XDefaultIMIF.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/X11/XDefaultIMIF.c')
-rw-r--r--nx-X11/lib/X11/XDefaultIMIF.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/nx-X11/lib/X11/XDefaultIMIF.c b/nx-X11/lib/X11/XDefaultIMIF.c
index db0f5d1fa..2eb52ae4a 100644
--- a/nx-X11/lib/X11/XDefaultIMIF.c
+++ b/nx-X11/lib/X11/XDefaultIMIF.c
@@ -184,16 +184,14 @@ _XDefaultOpenIM(
return((XIM)NULL);
}
- if ((im = Xmalloc(sizeof(StaticXIMRec))) == (StaticXIM)NULL) {
+ if ((im = Xcalloc(1, sizeof(StaticXIMRec))) == (StaticXIM)NULL) {
return((XIM)NULL);
}
- if ((local_impart = Xmalloc(sizeof(XIMStaticXIMRec)))
+ if ((local_impart = Xcalloc(1, sizeof(XIMStaticXIMRec)))
== (XIMStaticXIMRec *)NULL) {
Xfree(im);
return((XIM)NULL);
}
- memset(im, 0, sizeof(StaticXIMRec));
- memset(local_impart, 0, sizeof(XIMStaticXIMRec));
buf[0] = '\0';
i = 0;
@@ -344,10 +342,9 @@ _CreateIC(XIM im, XIMArg *arg)
{
XIC ic;
- if ((ic = Xmalloc(sizeof(XICRec))) == (XIC)NULL) {
+ if ((ic = Xcalloc(1, sizeof(XICRec))) == (XIC)NULL) {
return ((XIC)NULL);
}
- memset(ic, 0, sizeof(XICRec));
ic->methods = (XICMethods)&local_ic_methods;
ic->core.im = im;