summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/getsmbpass.c2
1 files changed, 1 insertions, 1 deletions
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 */