From 190039a378ee208a026f868d083d7c00918d1b5f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Oct 2007 14:01:15 +0200 Subject: r25682: r16320: Ensure variable is not null before calling fclose. Klocwork #412. Jeremy. (cherry picked from commit 33ee0cfb190a883229d0824d7194898fd8966ceb) (This used to be commit 3910d069413834744b17175bb29775a69002712e) --- source4/lib/replace/getpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/lib/replace/getpass.c b/source4/lib/replace/getpass.c index c67ff2bda7..dace5fbb8a 100644 --- a/source4/lib/replace/getpass.c +++ b/source4/lib/replace/getpass.c @@ -218,7 +218,7 @@ char *getsmbpass(const char *prompt) fprintf(out, "\n"); fflush(out); - if (in != stdin) /* We opened the terminal; now close it. */ + if (in && in != stdin) /* We opened the terminal; now close it. */ fclose(in); /* Catch problematic signals */ -- cgit