Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/msgs Avoid leaking a file handle on error opening th...



details:   https://anonhg.NetBSD.org/src/rev/63acd55eea5a
branches:  trunk
changeset: 342595:63acd55eea5a
user:      dholland <dholland%NetBSD.org@localhost>
date:      Thu Dec 31 01:16:47 2015 +0000

description:
Avoid leaking a file handle on error opening the next file. From
David Binderman in PR 50577.

diffstat:

 usr.bin/msgs/msgs.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r c54b48b1aa33 -r 63acd55eea5a usr.bin/msgs/msgs.c
--- a/usr.bin/msgs/msgs.c       Wed Dec 30 22:26:26 2015 +0000
+++ b/usr.bin/msgs/msgs.c       Thu Dec 31 01:16:47 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msgs.c,v 1.23 2013/10/18 20:47:06 christos Exp $       */
+/*     $NetBSD: msgs.c,v 1.24 2015/12/31 01:16:47 dholland Exp $       */
 
 /*-
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)msgs.c     8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: msgs.c,v 1.23 2013/10/18 20:47:06 christos Exp $");
+__RCSID("$NetBSD: msgs.c,v 1.24 2015/12/31 01:16:47 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -800,6 +800,7 @@
                        perror(fname);
                        mailing = NO;
                        fseek(newmsg, oldpos, 0);
+                       fclose(cpfrom);
                        ask(prompt);
                        return;
                }



Home | Main Index | Thread Index | Old Index