Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2018 17:42:55 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335071 - head/stand/libsa
Message-ID:  <201806131742.w5DHgtLD068127@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Wed Jun 13 17:42:55 2018
New Revision: 335071
URL: https://svnweb.freebsd.org/changeset/base/335071

Log:
  Initialize variables we later free so they aren't used
  uninitialized in the error path.
  Remove unused variables.
  
  Sponsored by: Netflix

Modified:
  head/stand/libsa/nfs.c

Modified: head/stand/libsa/nfs.c
==============================================================================
--- head/stand/libsa/nfs.c	Wed Jun 13 17:42:50 2018	(r335070)
+++ head/stand/libsa/nfs.c	Wed Jun 13 17:42:55 2018	(r335071)
@@ -249,7 +249,7 @@ int
 nfs_lookupfh(struct nfs_iodesc *d, const char *name, struct nfs_iodesc *newfd)
 {
 	void *pkt = NULL;
-	int len, rlen, pos;
+	int len, pos;
 	struct args {
 		uint32_t fhsize;
 		uint32_t fhplusname[1 +
@@ -465,14 +465,13 @@ int
 nfs_open(const char *upath, struct open_file *f)
 {
 	struct iodesc *desc;
-	struct nfs_iodesc *currfd;
+	struct nfs_iodesc *currfd = NULL;
 	char buf[2 * NFS_V3MAXFHSIZE + 3];
 	u_char *fh;
 	char *cp;
 	int i;
 #ifndef NFS_NOSYMLINK
-	struct nfs_iodesc *newfd;
-	struct nfsv3_fattrs *fa;
+	struct nfs_iodesc *newfd = NULL;
 	char *ncp;
 	int c;
 	char namebuf[NFS_MAXPATHLEN + 1];
@@ -480,7 +479,7 @@ nfs_open(const char *upath, struct open_file *f)
 	int nlinks = 0;
 #endif
 	int error;
-	char *path;
+	char *path = NULL;
 
 	if (netproto != NET_NFS)
 		return (EINVAL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806131742.w5DHgtLD068127>