From 27ad3d8619378bc0cb781dc043ae8cb409077810 Mon Sep 17 00:00:00 2001 From: rmind Date: Thu, 6 Sep 2007 01:11:44 +0000 Subject: [PATCH] nfs_mount: Plug a possible leaks. Invented in 1.114 rev. From CID: 4534 --- sys/nfs/nfs_vfsops.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index 0595d78868cc..c15b6a4d32f3 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_vfsops.c,v 1.184 2007/08/10 15:12:56 yamt Exp $ */ +/* $NetBSD: nfs_vfsops.c,v 1.185 2007/09/06 01:11:44 rmind Exp $ */ /* * Copyright (c) 1989, 1993, 1995 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.184 2007/08/10 15:12:56 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.185 2007/09/06 01:11:44 rmind Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -653,16 +653,16 @@ nfs_mount(struct mount *mp, const char *path, void *data, size_t *data_len, MALLOC(nfh, u_char *, NFSX_V3FHMAX, M_TEMP, M_WAITOK); error = copyin(args->fh, nfh, args->fhsize); if (error) - return (error); + goto free_nfh; MALLOC(pth, char *, MNAMELEN, M_TEMP, M_WAITOK); error = copyinstr(path, pth, MNAMELEN - 1, &len); if (error) - goto free_nfh; + goto free_pth; memset(&pth[len], 0, MNAMELEN - len); MALLOC(hst, char *, MNAMELEN, M_TEMP, M_WAITOK); error = copyinstr(args->hostname, hst, MNAMELEN - 1, &len); if (error) - goto free_pth; + goto free_hst; memset(&hst[len], 0, MNAMELEN - len); /* sockargs() call must be after above copyin() calls */ error = sockargs(&nam, args->addr, args->addrlen, MT_SONAME);