From be6ffd3449e444fcd8779d823f8791c72660bba7 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 14:53:02 +0100 Subject: [PATCH] Close the file opened in ReadPhondataManifest on error. --- src/prosodydisplay.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/prosodydisplay.cpp b/src/prosodydisplay.cpp index 36e64c9e..e25fba96 100644 --- a/src/prosodydisplay.cpp +++ b/src/prosodydisplay.cpp @@ -1,6 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 to 2014 by Jonathan Duddington * * email: jonsd@users.sourceforge.net * + * Copyright (C) 2015 by 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 * @@ -106,7 +107,10 @@ void ReadPhondataManifest() } if((manifest = (NAMETAB *)realloc(manifest, n_lines * sizeof(NAMETAB))) == NULL) + { + fclose(f); return; + } n_manifest = 0; while(fgets(buf, sizeof(buf), f) != NULL)