From: Todd C. Miller Date: Fri, 11 Nov 2005 16:22:58 +0000 (+0000) Subject: Fix fd leak when lecture file option is enabled. From Jerry Brown X-Git-Tag: SUDO_1_7_0~613 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50004e00b843fb59b9d8f3b5aa64e8cc4b7219aa;p=sudo Fix fd leak when lecture file option is enabled. From Jerry Brown --- diff --git a/check.c b/check.c index 3fb306181..0a4823f0b 100644 --- a/check.c +++ b/check.c @@ -126,6 +126,7 @@ lecture(status) if (def_lecture_file && (fp = fopen(def_lecture_file, "r")) != NULL) { while ((nread = fread(buf, sizeof(char), sizeof(buf), fp)) != 0) fwrite(buf, nread, 1, stderr); + fclose(fp); } else { (void) fputs("\n\ We trust you have received the usual lecture from the local System\n\