Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2018 09:10:34 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335127 - head/stand/libsa
Message-ID:  <201806140910.w5E9AYei041329@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Thu Jun 14 09:10:34 2018
New Revision: 335127
URL: https://svnweb.freebsd.org/changeset/base/335127

Log:
  libsa: remobe unneeded check before free()
  
  free() is checking for NULL, remove duplicate check.

Modified:
  head/stand/libsa/close.c

Modified: head/stand/libsa/close.c
==============================================================================
--- head/stand/libsa/close.c	Thu Jun 14 09:06:53 2018	(r335126)
+++ head/stand/libsa/close.c	Thu Jun 14 09:10:34 2018	(r335127)
@@ -75,10 +75,9 @@ close(int fd)
 		errno = EBADF;
 		return (-1);
 	}
-	if (f->f_rabuf != NULL) {
-		free(f->f_rabuf);
-		f->f_rabuf = NULL;
-	}
+	free(f->f_rabuf);
+	f->f_rabuf = NULL;
+
 	if (!(f->f_flags & F_RAW) && f->f_ops)
 		err1 = (f->f_ops->fo_close)(f);
 	if (!(f->f_flags & F_NODEV) && f->f_dev)



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