summaryrefslogtreecommitdiffstats
path: root/usr.bin/fstat
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/fstat')
-rw-r--r--usr.bin/fstat/msdosfs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/fstat/msdosfs.c b/usr.bin/fstat/msdosfs.c
index 6766677..dda7d17 100644
--- a/usr.bin/fstat/msdosfs.c
+++ b/usr.bin/fstat/msdosfs.c
@@ -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);
OpenPOWER on IntegriCloud