Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Apr 2019 06:49:46 +0000 (UTC)
From:      Poul-Henning Kamp <phk@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r346369 - head/sbin/md5
Message-ID:  <201904190649.x3J6nkdC086969@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: phk
Date: Fri Apr 19 06:49:46 2019
New Revision: 346369
URL: https://svnweb.freebsd.org/changeset/base/346369

Log:
  Close filedescriptors when done with them.

Modified:
  head/sbin/md5/md5.c

Modified: head/sbin/md5/md5.c
==============================================================================
--- head/sbin/md5/md5.c	Fri Apr 19 03:47:59 2019	(r346368)
+++ head/sbin/md5/md5.c	Fri Apr 19 06:49:46 2019	(r346369)
@@ -247,7 +247,9 @@ main(int argc, char *argv[])
 					err(1, "capsicum");
 #endif
 			}
-			if ((p = Algorithm[digest].Fd(fd, buf)) == NULL) {
+			p = Algorithm[digest].Fd(fd, buf);
+			(void)close(fd);
+			if (p == NULL) {
 				warn("%s", *argv);
 				failed++;
 			} else {



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