mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Do not cache and correctly free() dosmount entry in case of errors.
PR: 53980 (partially)
This commit is contained in:
parent
fedf1d01a2
commit
6c7aa7fe1b
1 changed files with 4 additions and 3 deletions
|
|
@ -100,15 +100,16 @@ msdosfs_filestat(vp, fsp)
|
|||
if (!mnt) {
|
||||
if ((mnt = malloc(sizeof(struct dosmount))) == NULL)
|
||||
err(1, NULL);
|
||||
mnt->next = mounts;
|
||||
mounts = mnt;
|
||||
mnt->kptr = denode.de_pmp;
|
||||
if (!KVM_READ(denode.de_pmp, &mnt->data, sizeof mnt->data)) {
|
||||
free(mnt);
|
||||
dprintf(stderr,
|
||||
"can't read mount info at %p for pid %d\n",
|
||||
(void *)denode.de_pmp, Pid);
|
||||
return 0;
|
||||
}
|
||||
mnt->next = mounts;
|
||||
mounts = mnt;
|
||||
mnt->kptr = denode.de_pmp;
|
||||
}
|
||||
|
||||
fsp->fsid = dev2udev(denode.de_dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue