diff options
author | christos <christos@NetBSD.org> | 2006-04-02 00:08:12 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 2006-04-02 00:08:12 +0000 |
commit | 2a0ca32306cf8058b56a50cfcd174303df8ec374 (patch) | |
tree | e7bf256a508265112b1f35d88845bd5da598900c /hack | |
parent | 077906a20219a303a84eefc70fdc53f61fe9d38e (diff) | |
download | bsdgames-darwin-2a0ca32306cf8058b56a50cfcd174303df8ec374.tar.gz bsdgames-darwin-2a0ca32306cf8058b56a50cfcd174303df8ec374.tar.zst bsdgames-darwin-2a0ca32306cf8058b56a50cfcd174303df8ec374.zip |
Coverity CID 2791: Fix file pointer leak.
Diffstat (limited to 'hack')
-rw-r--r-- | hack/hack.pager.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hack/hack.pager.c b/hack/hack.pager.c index 4b3ceed0..67962eea 100644 --- a/hack/hack.pager.c +++ b/hack/hack.pager.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.pager.c,v 1.8 2006/03/29 01:21:07 jnemeth Exp $ */ +/* $NetBSD: hack.pager.c,v 1.9 2006/04/02 00:08:12 christos Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: hack.pager.c,v 1.8 2006/03/29 01:21:07 jnemeth Exp $"); +__RCSID("$NetBSD: hack.pager.c,v 1.9 2006/04/02 00:08:12 christos Exp $"); #endif /* not lint */ /* This file contains the command routine dowhatis() and a pager. */ @@ -100,6 +100,7 @@ dowhatis() /* else: bad data file */ else { pline("Bad data file!"); + (void) fclose(fp); return(0); } /* Expand tab 'by hand' */ @@ -113,6 +114,7 @@ dowhatis() pline("More info? "); if (readchar() == 'y') { page_more(fp, 1); /* does fclose() */ + (void) fclose(fp); return (0); } } |