summaryrefslogtreecommitdiffstats
path: root/sys/fs/umapfs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-10-05 12:00:11 +0000
committerphk <phk@FreeBSD.org>2002-10-05 12:00:11 +0000
commit04470831a893428bc7b73109a204e87935c2c8f4 (patch)
tree5048adcf90fff20c78fa98c5165a0ba99adac98c /sys/fs/umapfs
parent89d8005f0102ab344020eebd41193f2045c526f7 (diff)
downloadFreeBSD-src-04470831a893428bc7b73109a204e87935c2c8f4.zip
FreeBSD-src-04470831a893428bc7b73109a204e87935c2c8f4.tar.gz
Plug memoryleaks detected by FlexeLint.
Diffstat (limited to 'sys/fs/umapfs')
-rw-r--r--sys/fs/umapfs/umap_vfsops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c
index adb419a..e33058f 100644
--- a/sys/fs/umapfs/umap_vfsops.c
+++ b/sys/fs/umapfs/umap_vfsops.c
@@ -170,6 +170,8 @@ umapfs_mount(mp, path, data, ndp, td)
if (args.nentries > MAPFILEENTRIES || args.gnentries >
GMAPFILEENTRIES) {
vput(lowerrootvp);
+ free(amp, M_UMAPFSMNT);
+ /* XXX missing error = EINVAL ? */
return (error);
}
@@ -177,8 +179,10 @@ umapfs_mount(mp, path, data, ndp, td)
amp->info_gnentries = args.gnentries;
error = copyin(args.mapdata, (caddr_t)amp->info_mapdata,
2*sizeof(u_long)*args.nentries);
- if (error)
+ if (error) {
+ free(amp, M_UMAPFSMNT);
return (error);
+ }
#ifdef DEBUG
printf("umap_mount:nentries %d\n",args.nentries);
@@ -189,8 +193,10 @@ umapfs_mount(mp, path, data, ndp, td)
error = copyin(args.gmapdata, (caddr_t)amp->info_gmapdata,
2*sizeof(u_long)*args.gnentries);
- if (error)
+ if (error) {
+ free(amp, M_UMAPFSMNT);
return (error);
+ }
#ifdef DEBUG
printf("umap_mount:gnentries %d\n",args.gnentries);
OpenPOWER on IntegriCloud