From d173f9d6561b223de0bf79603d303427da668a98 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 7 Apr 2006 16:01:03 +0000 Subject: Coverity #979, #980, #981: Avoid potential NULL dereferences. --- src/xkbout.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/xkbout.c b/src/xkbout.c index 7f8c8b5..5a2e4e1 100644 --- a/src/xkbout.c +++ b/src/xkbout.c @@ -135,11 +135,11 @@ Display * dpy; char * alternate; xkb= result->xkb; - dpy= xkb->dpy; - if ((!xkb)||(!xkb->names)||(!xkb->names->keys)) { + if ((!xkb)||(!xkb->names)||(!xkb->names->keys)||(!xkb->dpy)) { _XkbLibError(_XkbErrMissingNames,"XkbWriteXKBKeycodes",0); return False; } + dpy= xkb->dpy; kcName= xkb->names->keycodes; if (kcName!=None) fprintf(file,"xkb_keycodes \"%s\" {\n", @@ -199,11 +199,11 @@ XkbKTMapEntryPtr entry; XkbDescPtr xkb; xkb= result->xkb; - dpy= xkb->dpy; - if ((!xkb)||(!xkb->map)||(!xkb->map->types)) { + if ((!xkb)||(!xkb->map)||(!xkb->map->types)||(!xkb->dpy)) { _XkbLibError(_XkbErrMissingTypes,"XkbWriteXKBKeyTypes",0); return False; } + dpy= xkb->dpy; if (xkb->map->num_typesxkb; - dpy= xkb->dpy; - if ((!xkb)||(!xkb->compat)||(!xkb->compat->sym_interpret)) { + if ((!xkb)||(!xkb->compat)||(!xkb->compat->sym_interpret)||(!xkb->dpy)) { _XkbLibError(_XkbErrMissingCompatMap,"XkbWriteXKBCompatMap",0); return False; } + dpy= xkb->dpy; if ((xkb->names==NULL)||(xkb->names->compat==None)) fprintf(file,"xkb_compatibility {\n\n"); else fprintf(file,"xkb_compatibility \"%s\" {\n\n", -- cgit v1.2.3