Plug memory leaks.
Found by: Coverity Prevent analysis tool
This commit is contained in:
parent
42e1d99cc8
commit
f850b2781f
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user