summaryrefslogtreecommitdiffstats
path: root/pw/grupd.c
diff options
context:
space:
mode:
Diffstat (limited to 'pw/grupd.c')
-rw-r--r--pw/grupd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pw/grupd.c b/pw/grupd.c
index 9cbe0cb..38d5e5b 100644
--- a/pw/grupd.c
+++ b/pw/grupd.c
@@ -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()");