From f9af8a7b9cf8e217ca0f710a93b7ba5a4f341e82 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Fri, 19 Nov 2010 10:15:29 +0000 Subject: [PATCH] Close file and directory descriptors MFC after: 3 days --- usr.bin/at/at.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c index fbba7bd59027..c036013febbc 100644 --- a/usr.bin/at/at.c +++ b/usr.bin/at/at.c @@ -524,6 +524,7 @@ list_jobs(long *joblist, int len) jobno); } PRIV_END + closedir(spool); } static void @@ -594,6 +595,7 @@ process_jobs(int argc, char **argv, int what) while((ch = getc(fp)) != EOF) { putchar(ch); } + fclose(fp); } break; @@ -604,6 +606,7 @@ process_jobs(int argc, char **argv, int what) } } } + closedir(spool); } /* delete_jobs */ #define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;