diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 2f67c054f5f9..3ce2ea4ea0e2 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -412,7 +412,7 @@ vfs_setpublicfs(struct mount *mp, struct netexport *nep, * If an indexfile was specified, pull it in. */ if (argp->ex_indexfile != NULL) { - if (nfs_pub.np_index != NULL) + if (nfs_pub.np_index == NULL) nfs_pub.np_index = malloc(MAXNAMLEN + 1, M_TEMP, M_WAITOK); error = copyinstr(argp->ex_indexfile, nfs_pub.np_index,