mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
mountd: use free_iovec for build_iovec cleanup
Remove the handrolled cleanups and use free_iovec instead. No functional change intended. Logically, the change does remove one dead store to iovlen in get_exportlist(). Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D49953
This commit is contained in:
parent
92e9301e56
commit
5fa183f028
1 changed files with 2 additions and 25 deletions
|
|
@ -2099,19 +2099,7 @@ get_exportlist(int passno)
|
|||
syslog(LOG_ERR, "NFSv4 requires at least one V4: line");
|
||||
}
|
||||
|
||||
if (iov != NULL) {
|
||||
/* Free strings allocated by strdup() in getmntopts.c */
|
||||
free(iov[0].iov_base); /* fstype */
|
||||
free(iov[2].iov_base); /* fspath */
|
||||
free(iov[4].iov_base); /* from */
|
||||
free(iov[6].iov_base); /* update */
|
||||
free(iov[8].iov_base); /* export */
|
||||
free(iov[10].iov_base); /* errmsg */
|
||||
|
||||
/* free iov, allocated by realloc() */
|
||||
free(iov);
|
||||
iovlen = 0;
|
||||
}
|
||||
free_iovec(&iov, &iovlen);
|
||||
|
||||
/*
|
||||
* If there was no public fh, clear any previous one set.
|
||||
|
|
@ -3409,18 +3397,7 @@ skip:
|
|||
if (cp)
|
||||
*cp = savedc;
|
||||
error_exit:
|
||||
/* free strings allocated by strdup() in getmntopts.c */
|
||||
if (iov != NULL) {
|
||||
free(iov[0].iov_base); /* fstype */
|
||||
free(iov[2].iov_base); /* fspath */
|
||||
free(iov[4].iov_base); /* from */
|
||||
free(iov[6].iov_base); /* update */
|
||||
free(iov[8].iov_base); /* export */
|
||||
free(iov[10].iov_base); /* errmsg */
|
||||
|
||||
/* free iov, allocated by realloc() */
|
||||
free(iov);
|
||||
}
|
||||
free_iovec(&iov, &iovlen);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue