From 6f6d38d24a69aec614e443c6a5cd0d6ed6b1b70e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 15 Mar 2008 22:27:05 +0100 Subject: Fix Coverity ID 554 (cherry picked from commit 471b1b0c58bc2def5d2fe9d98401def34724d447) (This used to be commit effda48a2670325fed56e158539417c6f95381b8) --- source4/lib/replace/getpass.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/replace/getpass.c b/source4/lib/replace/getpass.c index 57e28eb981..73333b9021 100644 --- a/source4/lib/replace/getpass.c +++ b/source4/lib/replace/getpass.c @@ -187,6 +187,9 @@ char *rep_getpass(const char *prompt) in_fd = fileno(in); if (fgets(buf, bufsize, in) == NULL) { buf[0] = 0; + if (in && in != stdin) { + fclose(in); + } return buf; } } -- cgit