From 61c96308fb03cbb1308d109f047647fa095d1b06 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 fed55d653a73d09550a90a4904023580dd46ae76) --- source3/lib/getsmbpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/getsmbpass.c') diff --git a/source3/lib/getsmbpass.c b/source3/lib/getsmbpass.c index a7780f7c12..bebddc69eb 100644 --- a/source3/lib/getsmbpass.c +++ b/source3/lib/getsmbpass.c @@ -163,7 +163,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