From 89548feb7a1fe93029a8a346ed4dcc447b51102b Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 13 May 2006 22:29:53 +0000 Subject: Coverity CID 3508: Fix file leak. --- phantasia/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phantasia') diff --git a/phantasia/main.c b/phantasia/main.c index 9096e9f8..11dc6fb1 100644 --- a/phantasia/main.c +++ b/phantasia/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.15 2004/12/09 05:15:59 jmc Exp $ */ +/* $NetBSD: main.c,v 1.16 2006/05/13 22:29:53 christos Exp $ */ /* * Phantasia 3.3.2 -- Interterminal fantasy game @@ -719,8 +719,9 @@ titlelist() && fgets(Databuf, SZ_DATABUF, fp) != NULL) { mvaddstr(19, 25, "The last character to die was:"); mvaddstr(20, 40 - strlen(Databuf) / 2, Databuf); - fclose(fp); } + if (fp) + fclose(fp); refresh(); } -- cgit v1.2.3-56-ge451