From owner-svn-src-head@freebsd.org Thu Dec 28 05:33:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18A16EA7AAD; Thu, 28 Dec 2017 05:33:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C26FD6B497; Thu, 28 Dec 2017 05:33:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5XYqj024260; Thu, 28 Dec 2017 05:33:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XYQu024259; Thu, 28 Dec 2017 05:33:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XYQu024259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327266 - head/usr.bin/rpcgen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/rpcgen X-SVN-Commit-Revision: 327266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:36 -0000 Author: imp Date: Thu Dec 28 05:33:34 2017 New Revision: 327266 URL: https://svnweb.freebsd.org/changeset/base/327266 Log: Free some variables before they go out of scope. CID: 92074, 270099 Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Thu Dec 28 05:33:29 2017 (r327265) +++ head/usr.bin/rpcgen/rpc_main.c Thu Dec 28 05:33:34 2017 (r327266) @@ -484,7 +484,9 @@ generate_guard(const char *pathname) ; strcpy(guard, tmp); } + tmp = guard; guard = extendfile(guard, "_H_RPCGEN"); + free(tmp); return (guard); } @@ -502,13 +504,14 @@ h_output(const char *infile, const char *define, int e const char *guard; list *l; xdrfunc *xdrfuncp; + void *tmp = NULL; open_input(infile, define); outfilename = extend ? extendfile(infile, outfile) : outfile; open_output(infile, outfilename); add_warning(); if (outfilename || infile){ - guard = generate_guard(outfilename ? outfilename: infile); + guard = tmp = generate_guard(outfilename ? outfilename: infile); } else guard = "STDIN_"; @@ -574,6 +577,7 @@ h_output(const char *infile, const char *define, int e f_print(fout, "#endif\n"); f_print(fout, "\n#endif /* !_%s */\n", guard); + free(tmp); } /*