Author: metze
Date: 2007-10-17 14:01:15 +0000 (Wed, 17 Oct 2007)
New Revision: 25682

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25682

Log:
r16320: Ensure variable is not null before calling fclose. Klocwork #412. 
Jeremy.
(cherry picked from commit 33ee0cfb190a883229d0824d7194898fd8966ceb)

Modified:
   branches/SAMBA_4_0/source/lib/replace/getpass.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/getpass.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/getpass.c     2007-10-17 14:00:57 UTC 
(rev 25681)
+++ branches/SAMBA_4_0/source/lib/replace/getpass.c     2007-10-17 14:01:15 UTC 
(rev 25682)
@@ -218,7 +218,7 @@
        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 */

Reply via email to