diff options
author | christos <christos@NetBSD.org> | 2006-05-13 22:29:53 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 2006-05-13 22:29:53 +0000 |
commit | 89548feb7a1fe93029a8a346ed4dcc447b51102b (patch) | |
tree | 78898914b6918848908391bdbce5c1d1510ffd5a /phantasia | |
parent | 6380eb140ca001846a4b30a0d3ccd6a16f8e0a7d (diff) | |
download | bsdgames-darwin-89548feb7a1fe93029a8a346ed4dcc447b51102b.tar.gz bsdgames-darwin-89548feb7a1fe93029a8a346ed4dcc447b51102b.tar.zst bsdgames-darwin-89548feb7a1fe93029a8a346ed4dcc447b51102b.zip |
Coverity CID 3508: Fix file leak.
Diffstat (limited to 'phantasia')
-rw-r--r-- | phantasia/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
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(); } |