1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-12 09:58:36 +00:00

Do not cache and correctly free() dosmount entry in case of errors.

PR:		53980 (partially)
This commit is contained in:
Max Khon 2003-09-23 16:44:17 +00:00
parent fedf1d01a2
commit 6c7aa7fe1b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120384

View File

@ -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);