From 2a0ca32306cf8058b56a50cfcd174303df8ec374 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 2 Apr 2006 00:08:12 +0000 Subject: Coverity CID 2791: Fix file pointer leak. --- hack/hack.pager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'hack') 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 #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); } } -- cgit v1.2.3-56-ge451