diff options
author | 2016-10-21 20:17:19 +0000 | |
---|---|---|
committer | 2016-10-21 20:17:19 +0000 | |
commit | eaf8d4a9d903595d2f3a388ed56fd20b34d9f80b (patch) | |
tree | 568796d378b9962fc7a08cba2b8167f797aa4f35 /pw/grupd.c | |
parent | 677071471e7d81c72fc4e4a71e04441d010611ab (diff) | |
download | pw-darwin-eaf8d4a9d903595d2f3a388ed56fd20b34d9f80b.tar.gz pw-darwin-eaf8d4a9d903595d2f3a388ed56fd20b34d9f80b.tar.zst 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/grupd.c')
-rw-r--r-- | pw/grupd.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -34,6 +34,7 @@ static const char rcsid[] = #include <libutil.h> #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include "pwupd.h" @@ -73,8 +74,10 @@ gr_update(struct group * grp, char const * group) } if (gr_copy(pfd, tfd, gr, old_gr) == -1) { gr_fini(); + close(tfd); err(1, "gr_copy()"); } + close(tfd); if (gr_mkdb() == -1) { gr_fini(); err(1, "gr_mkdb()"); |