nfs: Avoid free of uninitialized on bad name size in create, mknod.

XXX These error branches are a nightmare and need to be more
systematically cleaned up.  Even if they are correct now, they are
impossible to audit and extremely fragile in case anyone ever needs
to make other changes to them.

XXX pullup-8
XXX pullup-9
XXX pullup-10
This commit is contained in:
riastradh 2023-03-23 19:53:01 +00:00
parent c6ac016a00
commit 9bb8bd4829
1 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_serv.c,v 1.183 2022/04/27 17:38:52 hannken Exp $ */
/* $NetBSD: nfs_serv.c,v 1.184 2023/03/23 19:53:01 riastradh Exp $ */
/*
* Copyright (c) 1989, 1993
@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.183 2022/04/27 17:38:52 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.184 2023/03/23 19:53:01 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1648,10 +1648,10 @@ nfsmout:
vput(nd.ni_dvp);
if (nd.ni_vp)
vput(nd.ni_vp);
}
if (nd.ni_pathbuf != NULL) {
pathbuf_destroy(nd.ni_pathbuf);
nd.ni_pathbuf = NULL;
if (nd.ni_pathbuf != NULL) {
pathbuf_destroy(nd.ni_pathbuf);
nd.ni_pathbuf = NULL;
}
}
return (error);
}
@ -1801,10 +1801,10 @@ nfsmout:
vput(nd.ni_dvp);
if (nd.ni_vp)
vput(nd.ni_vp);
}
if (nd.ni_pathbuf != NULL) {
pathbuf_destroy(nd.ni_pathbuf);
nd.ni_pathbuf = NULL;
if (nd.ni_pathbuf != NULL) {
pathbuf_destroy(nd.ni_pathbuf);
nd.ni_pathbuf = NULL;
}
}
if (dirp)
vrele(dirp);