Coverity CID/4421: Add extra check for NULL before deref.

This commit is contained in:
christos 2007-04-04 21:40:48 +00:00
parent 3651f3e73b
commit 99a3390caf
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: amfs_generic.c,v 1.5 2006/04/05 14:59:29 christos Exp $ */
/* $NetBSD: amfs_generic.c,v 1.6 2007/04/04 21:40:48 christos Exp $ */
/*
* Copyright (c) 1997-2005 Erez Zadok
@ -1115,7 +1115,7 @@ amfs_generic_mount_child(am_node *new_mp, int *error_return)
new_mp->am_transp = (SVCXPRT *) xmalloc(sizeof(SVCXPRT));
*(new_mp->am_transp) = *current_transp;
}
if (error && (new_mp->am_mnt->mf_ops == &amfs_error_ops))
if (error && new_mp->am_mnt && (new_mp->am_mnt->mf_ops == &amfs_error_ops))
new_mp->am_error = error;
if (new_mp->am_error > 0)