Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/nfs Fix memory leak introduced with the struct pathbuf c...
details: https://anonhg.NetBSD.org/src/rev/fc32fdcd470d
branches: trunk
changeset: 763422:fc32fdcd470d
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Mar 19 01:34:24 2011 +0000
description:
Fix memory leak introduced with the struct pathbuf changes. Hi, me.
Closes PR 44625.
diffstat:
sys/nfs/nfs_serv.c | 10 ++++++++--
sys/nfs/nfs_srvsubs.c | 5 +++--
2 files changed, 11 insertions(+), 4 deletions(-)
diffs (57 lines):
diff -r 385aa31c3823 -r fc32fdcd470d sys/nfs/nfs_serv.c
--- a/sys/nfs/nfs_serv.c Fri Mar 18 23:53:26 2011 +0000
+++ b/sys/nfs/nfs_serv.c Sat Mar 19 01:34:24 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_serv.c,v 1.156 2011/02/05 13:35:11 yamt Exp $ */
+/* $NetBSD: nfs_serv.c,v 1.157 2011/03/19 01:34:24 dholland Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.156 2011/02/05 13:35:11 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.157 2011/03/19 01:34:24 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -463,6 +463,12 @@
}
if (error) {
+ if (nd.ni_pathbuf != NULL) {
+ pathbuf_destroy(nd.ni_pathbuf);
+ }
+ if (ipb != NULL) {
+ pathbuf_destroy(ipb);
+ }
nfsm_reply(NFSX_POSTOPATTR(v3));
nfsm_srvpostop_attr(dirattr_ret, &dirattr);
return (0);
diff -r 385aa31c3823 -r fc32fdcd470d sys/nfs/nfs_srvsubs.c
--- a/sys/nfs/nfs_srvsubs.c Fri Mar 18 23:53:26 2011 +0000
+++ b/sys/nfs/nfs_srvsubs.c Sat Mar 19 01:34:24 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_srvsubs.c,v 1.8 2010/11/30 10:30:03 dholland Exp $ */
+/* $NetBSD: nfs_srvsubs.c,v 1.9 2011/03/19 01:34:24 dholland Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_srvsubs.c,v 1.8 2010/11/30 10:30:03 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_srvsubs.c,v 1.9 2011/03/19 01:34:24 dholland Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -276,6 +276,7 @@
out:
if (ndp->ni_pathbuf != NULL) {
pathbuf_destroy(ndp->ni_pathbuf);
+ ndp->ni_pathbuf = NULL;
} else {
PNBUF_PUT(path);
}
Home |
Main Index |
Thread Index |
Old Index