<<< Date Index >>>     <<< Thread Index >>>

[PATCH 2 of 3] The file pointer that needs checking is s.fpout, not fp



# HG changeset patch
# User Erik Hovland <erik@xxxxxxxxxxx>
# Date 1235084929 28800
# Node ID 060ecc0ef231ebb0bb40b0e136b254e9c4265696
# Parent  0c8acbc98286b13b311d0f0c24987585eff05bf4
The file pointer that needs checking is s.fpout, not fp.

Since fp cannot be anything but null, the likely file that needs
to be closed is s.fpout. Especially since the unlink is for the
tempfile - which is what s.fpout points to.

diff -r 0c8acbc98286 -r 060ecc0ef231 pattern.c
--- a/pattern.c Thu Feb 19 15:07:36 2009 -0800
+++ b/pattern.c Thu Feb 19 15:08:49 2009 -0800
@@ -193,9 +193,9 @@
             && !crypt_valid_passphrase(h->security))
        {
          mx_close_message (&msg);
-         if (fp)
+         if (s.fpout)
          {
-           fclose (fp);
+           fclose (s.fpout);
            unlink (tempfile);
          }
          return (0);