summaryrefslogtreecommitdiffstats
path: root/pw/pwupd.c
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2016-10-21 20:17:19 +0000
committerAlan Somers <asomers@FreeBSD.org>2016-10-21 20:17:19 +0000
commiteaf8d4a9d903595d2f3a388ed56fd20b34d9f80b (patch)
tree568796d378b9962fc7a08cba2b8167f797aa4f35 /pw/pwupd.c
parent677071471e7d81c72fc4e4a71e04441d010611ab (diff)
downloadpw-darwin-eaf8d4a9d903595d2f3a388ed56fd20b34d9f80b.tar.gz
pw-darwin-eaf8d4a9d903595d2f3a388ed56fd20b34d9f80b.zip
Close some file descriptor leaks in pw
MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8245
Diffstat (limited to 'pw/pwupd.c')
-rw-r--r--pw/pwupd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pw/pwupd.c b/pw/pwupd.c
index ee23952..3bcb95f 100644
--- a/pw/pwupd.c
+++ b/pw/pwupd.c
@@ -111,8 +111,10 @@ pw_update(struct passwd * pwd, char const * user)
}
if (pw_copy(pfd, tfd, pw, old_pw) == -1) {
pw_fini();
+ close(tfd);
err(1, "pw_copy()");
}
+ close(tfd);
/*
* in case of deletion of a user, the whole database
* needs to be regenerated