Reverse the check to allocate the buffer if cached pointer is NULL.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D13596
This commit is contained in:
Alexander Kabaev 2017-12-23 17:55:19 +00:00
parent 4daa09f343
commit 6d41588b6b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327114

View File

@ -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,