From 0b7a5a6ff196fb9e5ee1149a141cbe8b63dcd752 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 16:46:25 +0100 Subject: [PATCH] Free new_translator on error in LoadVoice. --- src/voices.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/voices.cpp b/src/voices.cpp index 02b84e52..5c2a327f 100644 --- a/src/voices.cpp +++ b/src/voices.cpp @@ -1,6 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 to 2015 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 * @@ -1099,7 +1100,10 @@ voice_t *LoadVoice(const char *vname, int control) new_translator->dict_min_size = dict_min; LoadDictionary(new_translator, new_dictionary, control & 4); if(dictionary_name[0]==0) + { + DeleteTranslator(new_translator); return(NULL); // no dictionary loaded + } new_translator->dict_condition = conditional_rules;