Guard against freeing NULL if vfs_mountroot_try is called with NULL
as an argument (this is legal to make other code simpler).
This commit is contained in:
parent
fd9ec25aaa
commit
c161a8754f
@ -199,8 +199,10 @@ vfs_mountroot_try(char *mountfrom)
|
||||
error = VFS_MOUNT(mp, NULL, NULL, NULL, curproc);
|
||||
|
||||
done:
|
||||
free(vfsname, M_MOUNT);
|
||||
free(path, M_MOUNT);
|
||||
if (vfsname != NULL)
|
||||
free(vfsname, M_MOUNT);
|
||||
if (path != NULL)
|
||||
free(path, M_MOUNT);
|
||||
if (error != 0) {
|
||||
if (mp != NULL)
|
||||
free(mp, M_MOUNT);
|
||||
|
@ -199,8 +199,10 @@ vfs_mountroot_try(char *mountfrom)
|
||||
error = VFS_MOUNT(mp, NULL, NULL, NULL, curproc);
|
||||
|
||||
done:
|
||||
free(vfsname, M_MOUNT);
|
||||
free(path, M_MOUNT);
|
||||
if (vfsname != NULL)
|
||||
free(vfsname, M_MOUNT);
|
||||
if (path != NULL)
|
||||
free(path, M_MOUNT);
|
||||
if (error != 0) {
|
||||
if (mp != NULL)
|
||||
free(mp, M_MOUNT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user