From 04470831a893428bc7b73109a204e87935c2c8f4 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 5 Oct 2002 12:00:11 +0000 Subject: [PATCH] Plug memoryleaks detected by FlexeLint. --- sys/fs/umapfs/umap_vfsops.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c index adb419af42c8..e33058fb692e 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);