Clear the mountprog variable after each mountfs() call so that mountprog
options don't leak over into subsequent mounts listed in /etc/fstab. While here, fix a memory leak in debug mode. Reported by: rank1seeker @ gmail Approved by: re (kib) MFC after: 1 week
This commit is contained in:
parent
cdd4eea9fc
commit
d2e17ce906
@ -589,6 +589,9 @@ mountfs(const char *vfstype, const char *spec, const char *name, int flags,
|
||||
for (i = 1; i < mnt_argv.c; i++)
|
||||
(void)printf(" %s", mnt_argv.a[i]);
|
||||
(void)printf("\n");
|
||||
free(optbuf);
|
||||
free(mountprog);
|
||||
mountprog = NULL;
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -599,6 +602,8 @@ mountfs(const char *vfstype, const char *spec, const char *name, int flags,
|
||||
}
|
||||
|
||||
free(optbuf);
|
||||
free(mountprog);
|
||||
mountprog = NULL;
|
||||
|
||||
if (verbose) {
|
||||
if (statfs(name, &sf) < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user