keyBind: Use Xcalloc to initialize allocated _XKeytrans

Using uninitialized value "p->modifiers"

Small fix by using Xcalloc instead of Xmalloc

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
This commit is contained in:
Erkki Seppälä 2011-01-10 16:37:22 +02:00
parent b993d73bb3
commit 6a4d027284

View file

@ -996,7 +996,7 @@ XRebindKeysym (
tmp = dpy->key_bindings;
nb = sizeof(KeySym) * nm;
if ((! (p = (struct _XKeytrans *) Xmalloc( sizeof(struct _XKeytrans)))) ||
if ((! (p = (struct _XKeytrans *) Xcalloc( 1, sizeof(struct _XKeytrans)))) ||
((! (p->string = (char *) Xmalloc( (unsigned) nbytes))) &&
(nbytes > 0)) ||
((! (p->modifiers = (KeySym *) Xmalloc( (unsigned) nb))) &&