From fd687c3162a604c98d98080bb3712a6779a130bd Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 16:53:34 +0100 Subject: [PATCH] Close f on error in LoadDictionary. --- src/dictionary.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dictionary.cpp b/src/dictionary.cpp index 8cabe528..e5b5c857 100644 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 to 2014 by Jonathan Duddington * * email: jonsd@users.sourceforge.net * - * Copyright (C) 2013 Reece H. Dunn * + * Copyright (C) 2013-2015 Reece H. Dunn * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -269,6 +269,8 @@ int LoadDictionary(Translator *tr, const char *name, int no_error) { fprintf(stderr,"Can't read dictionary file: '%s'\n",fname); } + if (f != NULL) + fclose(f); return(1); }