Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Dec 2017 05:33:19 +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: r327263 - head/usr.sbin/btxld
Message-ID:  <201712280533.vBS5XJRC024098@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Dec 28 05:33:19 2017
New Revision: 327263
URL: https://svnweb.freebsd.org/changeset/base/327263

Log:
  Explicitly ignore return value from remove. We wouldn't do anything
  differently if we can't unlink the temporary file. Also, free the
  temporary file name when we set it to NULL.
  
  CID: 1006909, 719448

Modified:
  head/usr.sbin/btxld/btxld.c

Modified: head/usr.sbin/btxld/btxld.c
==============================================================================
--- head/usr.sbin/btxld/btxld.c	Thu Dec 28 05:32:59 2017	(r327262)
+++ head/usr.sbin/btxld/btxld.c	Thu Dec 28 05:33:19 2017	(r327263)
@@ -189,7 +189,7 @@ static void
 cleanup(void)
 {
     if (tname)
-	remove(tname);
+	(void)remove(tname);
 }
 
 /*
@@ -287,6 +287,7 @@ btxld(const char *iname)
 	err(2, "%s", tname);
     if (rename(tname, oname))
 	err(2, "%s: Can't rename to %s", tname, oname);
+    free((void*)(intptr_t)tname);
     tname = NULL;
     if (verbose) {
 	printf(binfo, btx.btx_majver, btx.btx_minver, btx.btx_textsz,



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