summaryrefslogtreecommitdiff
path: root/source3/lib/replace
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-03-15 22:27:05 +0100
committerVolker Lendecke <vl@samba.org>2008-03-15 22:30:25 +0100
commit2157f67e3809a594d7c8f84c077311f9e6995e37 (patch)
tree352f0ac112be3a40367b88621e517332e878c83d /source3/lib/replace
parente2ab1a0f98e04e8d5b81ef485f3fd6986cec206f (diff)
downloadsamba-2157f67e3809a594d7c8f84c077311f9e6995e37.tar.gz
samba-2157f67e3809a594d7c8f84c077311f9e6995e37.tar.bz2
samba-2157f67e3809a594d7c8f84c077311f9e6995e37.zip
Fix Coverity ID 554
(This used to be commit 471b1b0c58bc2def5d2fe9d98401def34724d447)
Diffstat (limited to 'source3/lib/replace')
-rw-r--r--source3/lib/replace/getpass.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/lib/replace/getpass.c b/source3/lib/replace/getpass.c
index 57e28eb981..73333b9021 100644
--- a/source3/lib/replace/getpass.c
+++ b/source3/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;
}
}