From ef7994f08460fd6578aadccfe50858a60b6613e7 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 14:56:58 +0100 Subject: [PATCH] Free p on error in ReadPhFile. --- src/synthdata.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/synthdata.cpp b/src/synthdata.cpp index a82d77d0..1cce9929 100644 --- a/src/synthdata.cpp +++ b/src/synthdata.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 * @@ -98,6 +99,7 @@ static char *ReadPhFile(void *ptr, const char *fname, int *size) if(fread(p,1,length,f_in) != length) { fclose(f_in); + Free(p); return(NULL); }