aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_mount.c
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2005-05-11 19:27:38 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2005-05-11 19:27:38 +0000
commitf850b2781f44b5503f39a1cbcc55ee8e167f52a1 (patch)
tree1098d6af02dea13ef688afb9d83ca626ced436e0 /sys/kern/vfs_mount.c
parent42e1d99cc8ab431dcb375eddec8fe101c6832642 (diff)
downloadsrc-f850b2781f44b5503f39a1cbcc55ee8e167f52a1.tar.gz
src-f850b2781f44b5503f39a1cbcc55ee8e167f52a1.zip
Plug memory leaks.
Found by: Coverity Prevent analysis tool
Notes
Notes: svn path=/head/; revision=146116
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r--sys/kern/vfs_mount.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 7a3764e81321..2e11ab4c91b8 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1293,11 +1293,8 @@ vfs_mountroot_try(const char *mountfrom)
path = malloc(MNAMELEN, M_MOUNT, M_WAITOK);
vfsname[0] = path[0] = 0;
sprintf(patt, "%%%d[a-z0-9]:%%%ds", MFSNAMELEN, MNAMELEN);
- if (sscanf(mountfrom, patt, vfsname, path) < 1) {
- free(path, M_MOUNT);
- free(vfsname, M_MOUNT);
- return (error);
- }
+ if (sscanf(mountfrom, patt, vfsname, path) < 1)
+ goto out;
if (path[0] == '\0')
strcpy(path, ROOTNAME);
@@ -1331,6 +1328,9 @@ vfs_mountroot_try(const char *mountfrom)
devfs_fixup(curthread);
}
+out:
+ free(path, M_MOUNT);
+ free(vfsname, M_MOUNT);
return (error);
}