Coverity CID 1329: Possible NULL deref.

This commit is contained in:
christos 2006-03-18 05:17:36 +00:00
parent 0c0f6ae5dc
commit 169a269417
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec.c,v 1.37 2003/08/07 09:05:31 agc Exp $ */ /* $NetBSD: exec.c,v 1.38 2006/03/18 05:17:36 christos Exp $ */
/*- /*-
* Copyright (c) 1991, 1993 * Copyright (c) 1991, 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95"; static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
#else #else
__RCSID("$NetBSD: exec.c,v 1.37 2003/08/07 09:05:31 agc Exp $"); __RCSID("$NetBSD: exec.c,v 1.38 2006/03/18 05:17:36 christos Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -363,7 +363,8 @@ hashcmd(int argc, char **argv)
if (verbose) { if (verbose) {
if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */
cmdp = cmdlookup(name, 0); cmdp = cmdlookup(name, 0);
printentry(cmdp, verbose); if (cmdp != NULL)
printentry(cmdp, verbose);
} }
flushall(); flushall();
} }