Source-Changes-HG archive

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

[src/trunk]: src/sbin/rcorder Fix bug introduced in previous; don't leak file...



details:   https://anonhg.NetBSD.org/src/rev/5a034ec759a5
branches:  trunk
changeset: 485972:5a034ec759a5
user:      enami <enami%NetBSD.org@localhost>
date:      Wed May 10 02:04:27 2000 +0000

description:
Fix bug introduced in previous; don't leak file pointers.

diffstat:

 sbin/rcorder/rcorder.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 4fb39f936d4f -r 5a034ec759a5 sbin/rcorder/rcorder.c
--- a/sbin/rcorder/rcorder.c    Wed May 10 01:36:56 2000 +0000
+++ b/sbin/rcorder/rcorder.c    Wed May 10 02:04:27 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rcorder.c,v 1.3 2000/05/09 04:21:16 enami Exp $        */
+/*     $NetBSD: rcorder.c,v 1.4 2000/05/10 02:04:27 enami Exp $        */
 
 /*
  * Copyright (c) 1998, 1999 Matthew R. Green
@@ -411,11 +411,13 @@
 
        if (fstat(fileno(fp), &st) == -1) {
                warn("could not stat %s", filename);
+               fclose(fp);
                return;
        }
 
        if (!S_ISREG(st.st_mode)) {
                warnx("%s is not a file", filename);
+               fclose(fp);
                return;
        }
 



Home | Main Index | Thread Index | Old Index