MFV r277866

amd: Add extra check for NULL before deref.

CID:		274421
Obtained from:	NetBSD
MFC after:	4 days
This commit is contained in:
pfg 2015-01-29 01:28:39 +00:00
parent 6789315d88
commit 9608c0caa1

View File

@ -1113,7 +1113,7 @@ amfs_generic_mount_child(am_node *new_mp, int *error_return)
new_mp->am_transp = (SVCXPRT *) xmalloc(sizeof(SVCXPRT)); new_mp->am_transp = (SVCXPRT *) xmalloc(sizeof(SVCXPRT));
*(new_mp->am_transp) = *current_transp; *(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; new_mp->am_error = error;
if (new_mp->am_error > 0) if (new_mp->am_error > 0)