Don't try and free mrep twice on some error conditions.
Obtained from: NetBSD
This commit is contained in:
parent
6301c8c330
commit
e9156323b8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36520
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
|
||||
* $Id: nfsm_subs.h,v 1.17 1998/05/31 17:27:57 peter Exp $
|
||||
* $Id: nfsm_subs.h,v 1.18 1998/05/31 17:48:07 peter Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -337,7 +337,10 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
|
||||
else \
|
||||
(void) nfs_rephead((s), nfsd, slp, error, cache, &frev, \
|
||||
mrq, &mb, &bpos); \
|
||||
m_freem(mrep); \
|
||||
if (mrep != NULL) { \
|
||||
m_freem(mrep); \
|
||||
mrep = NULL; \
|
||||
} \
|
||||
mreq = *mrq; \
|
||||
if (error && (!(nfsd->nd_flag & ND_NFSV3) || \
|
||||
error == EBADRPC)) \
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
|
||||
* $Id: nfs_vfsops.c,v 1.64 1998/05/30 16:33:57 peter Exp $
|
||||
* $Id: nfs_vfsops.c,v 1.65 1998/05/31 17:27:54 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -278,11 +278,12 @@ nfs_statfs(mp, sbp, p)
|
||||
nfsm_request(vp, NFSPROC_FSSTAT, p, cred);
|
||||
if (v3)
|
||||
nfsm_postop_attr(vp, retattr);
|
||||
if (!error) {
|
||||
nfsm_dissect(sfp, struct nfs_statfs *, NFSX_STATFS(v3));
|
||||
} else
|
||||
if (error) {
|
||||
if (mrep != NULL)
|
||||
m_free(mrep);
|
||||
goto nfsmout;
|
||||
|
||||
}
|
||||
nfsm_dissect(sfp, struct nfs_statfs *, NFSX_STATFS(v3));
|
||||
sbp->f_type = MOUNT_NFS;
|
||||
sbp->f_flags = nmp->nm_flag;
|
||||
sbp->f_iosize = nfs_iosize(nmp);
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
|
||||
* $Id: nfsm_subs.h,v 1.17 1998/05/31 17:27:57 peter Exp $
|
||||
* $Id: nfsm_subs.h,v 1.18 1998/05/31 17:48:07 peter Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -337,7 +337,10 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
|
||||
else \
|
||||
(void) nfs_rephead((s), nfsd, slp, error, cache, &frev, \
|
||||
mrq, &mb, &bpos); \
|
||||
m_freem(mrep); \
|
||||
if (mrep != NULL) { \
|
||||
m_freem(mrep); \
|
||||
mrep = NULL; \
|
||||
} \
|
||||
mreq = *mrq; \
|
||||
if (error && (!(nfsd->nd_flag & ND_NFSV3) || \
|
||||
error == EBADRPC)) \
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
|
||||
* $Id: nfs_vfsops.c,v 1.64 1998/05/30 16:33:57 peter Exp $
|
||||
* $Id: nfs_vfsops.c,v 1.65 1998/05/31 17:27:54 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -278,11 +278,12 @@ nfs_statfs(mp, sbp, p)
|
||||
nfsm_request(vp, NFSPROC_FSSTAT, p, cred);
|
||||
if (v3)
|
||||
nfsm_postop_attr(vp, retattr);
|
||||
if (!error) {
|
||||
nfsm_dissect(sfp, struct nfs_statfs *, NFSX_STATFS(v3));
|
||||
} else
|
||||
if (error) {
|
||||
if (mrep != NULL)
|
||||
m_free(mrep);
|
||||
goto nfsmout;
|
||||
|
||||
}
|
||||
nfsm_dissect(sfp, struct nfs_statfs *, NFSX_STATFS(v3));
|
||||
sbp->f_type = MOUNT_NFS;
|
||||
sbp->f_flags = nmp->nm_flag;
|
||||
sbp->f_iosize = nfs_iosize(nmp);
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
|
||||
* $Id: nfsm_subs.h,v 1.17 1998/05/31 17:27:57 peter Exp $
|
||||
* $Id: nfsm_subs.h,v 1.18 1998/05/31 17:48:07 peter Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -337,7 +337,10 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
|
||||
else \
|
||||
(void) nfs_rephead((s), nfsd, slp, error, cache, &frev, \
|
||||
mrq, &mb, &bpos); \
|
||||
m_freem(mrep); \
|
||||
if (mrep != NULL) { \
|
||||
m_freem(mrep); \
|
||||
mrep = NULL; \
|
||||
} \
|
||||
mreq = *mrq; \
|
||||
if (error && (!(nfsd->nd_flag & ND_NFSV3) || \
|
||||
error == EBADRPC)) \
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
|
||||
* $Id: nfsm_subs.h,v 1.17 1998/05/31 17:27:57 peter Exp $
|
||||
* $Id: nfsm_subs.h,v 1.18 1998/05/31 17:48:07 peter Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -337,7 +337,10 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
|
||||
else \
|
||||
(void) nfs_rephead((s), nfsd, slp, error, cache, &frev, \
|
||||
mrq, &mb, &bpos); \
|
||||
m_freem(mrep); \
|
||||
if (mrep != NULL) { \
|
||||
m_freem(mrep); \
|
||||
mrep = NULL; \
|
||||
} \
|
||||
mreq = *mrq; \
|
||||
if (error && (!(nfsd->nd_flag & ND_NFSV3) || \
|
||||
error == EBADRPC)) \
|
||||
|
Loading…
Reference in New Issue
Block a user