r16320: Ensure variable is not null before calling fclose. Klocwork #412. Jeremy.
authorJeremy Allison <jra@samba.org>
Fri, 16 Jun 2006 23:07:42 +0000 (23:07 +0000)
committerStefan Metzmacher <metze@samba.org>
Mon, 15 Oct 2007 11:20:41 +0000 (13:20 +0200)
source/lib/replace/getpass.c

index c67ff2bda779620503cce5d1eeefcb10a3ec6f2b..dace5fbb8a2136957c26557dc10d3a5774720e7f 100644 (file)
@@ -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 */