From a09bc48a1db9dcf4cb844dc8e2075035031773e1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Jun 2006 23:07:42 +0000 Subject: r16320: Ensure variable is not null before calling fclose. Klocwork #412. Jeremy. (This used to be commit 33ee0cfb190a883229d0824d7194898fd8966ceb) --- source3/lib/replace/getpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/replace/getpass.c') diff --git a/source3/lib/replace/getpass.c b/source3/lib/replace/getpass.c index c67ff2bda7..dace5fbb8a 100644 --- a/source3/lib/replace/getpass.c +++ b/source3/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