From 61522a12a38453a4e854fd9c9e0994ad80420243 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 13:39:00 +0100 Subject: [PATCH 01/22] espeakedit: fix argument processing for unicode argv types --- src/espeakedit.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/espeakedit.cpp b/src/espeakedit.cpp index 361e7194..f9a04639 100644 --- a/src/espeakedit.cpp +++ b/src/espeakedit.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 to 2015 by Jonathan Duddington * * email: jonsd@users.sourceforge.net * - * Copyright (C) 2013 by Reece H. Dunn * + * Copyright (C) 2013-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 * @@ -111,21 +111,21 @@ static const char *help_text = "\tCompile phoneme data in espeak-data/phsource\n" "\tand dictionary data in espeak-data/dictsource\n"; - // Initialise this in OnInit, not statically bool MyApp::OnInit(void) {//===================== int j; -const wxChar *p; char param[120]; - if(argc > 1) { - p = argv[1]; - j = 0; +#if wxUSE_UNICODE == 1 + wcstombs(param, argv[1], sizeof(param)); +#else + const char *p = argv[1]; while((param[j] = p[j]) != 0) j++; +#endif if((strcmp(param,"--help")==0) || (strcmp(param,"-h")==0)) { From 6ae765f0f4135722d30d25a33fae346c0300d7e6 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 13:41:16 +0100 Subject: [PATCH 02/22] Delete spectseq on error conditions. --- src/compiledata.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiledata.cpp b/src/compiledata.cpp index 74033501..8a0e57bd 100644 --- a/src/compiledata.cpp +++ b/src/compiledata.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 to 2014 by Jonathan Duddington * * email: jonsd@users.sourceforge.net * - * Copyright (C) 2013 by Reece H. Dunn * + * Copyright (C) 2013-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 * @@ -1649,6 +1649,7 @@ int LoadSpect(const char *path, int control) if(stream.Ok() == FALSE) { error("Failed to open: '%s'",path); + delete spectseq; return(0); } spectseq->Load(stream); @@ -1656,6 +1657,7 @@ int LoadSpect(const char *path, int control) if(spectseq->frames == NULL) { error("Bad vowel file, no frames: '%s'",path); + delete spectseq; return(0); } From af16ee6327605b8ba235d3d4670eb84a1b9f4235 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 13:42:25 +0100 Subject: [PATCH 03/22] Free tune_data when returning from CompileIntonation. --- src/compiledata.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiledata.cpp b/src/compiledata.cpp index 8a0e57bd..03c816a2 100644 --- a/src/compiledata.cpp +++ b/src/compiledata.cpp @@ -3999,6 +3999,7 @@ void CompileIntonation() { fclose(f_in); fclose(f_errors); + free(tune_data); return; } @@ -4185,6 +4186,7 @@ void CompileIntonation() } } fwrite(tune_data, n_tune_names, sizeof(TUNE), f_out); + free(tune_data); fclose(f_in); fclose(f_out); From a23c5a6f769cb5bb5005779dcf0916bfce045868 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 13:44:10 +0100 Subject: [PATCH 04/22] Move MENU_ABOUT related objects into the MENU_ABOUT handler to avoid memory leaks. --- src/espeakedit.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/espeakedit.cpp b/src/espeakedit.cpp index f9a04639..4fe48840 100644 --- a/src/espeakedit.cpp +++ b/src/espeakedit.cpp @@ -559,23 +559,20 @@ void MyFrame::OnAbout(wxCommandEvent& event) char buf[300]; wxString url_docs; - wxBoxSizer *topsizer; - HtmlWindow *html; - wxDialog dlg(this, wxID_ANY, wxString(_("About"))); - - topsizer = new wxBoxSizer(wxVERTICAL); - switch(event.GetId()) { case MENU_ABOUT: { + wxDialog dlg(this, wxID_ANY, wxString(_("About"))); + sprintf(buf,about_string,espeak_Info(NULL)); - html = new HtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER); + HtmlWindow *html = new HtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER); html -> SetBorders(0); html -> SetPage(wxString(buf,wxConvLocal)); html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(), html -> GetInternalRepresentation() -> GetHeight()); + wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); topsizer -> Add(html, 1, wxALL, 10); //#if wxUSE_STATLINE From 94eefd46d19bd3b8bf50c2592f2fa6a116bb61f8 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 13:44:58 +0100 Subject: [PATCH 05/22] Delete spectseq on error conditions. --- src/spectdisplay.cpp | 1 + src/spectseq.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spectdisplay.cpp b/src/spectdisplay.cpp index 5b25293b..77161cf1 100644 --- a/src/spectdisplay.cpp +++ b/src/spectdisplay.cpp @@ -993,6 +993,7 @@ void MyFrame::OnNewWindow(wxCommandEvent& event) if(stream.Ok() == FALSE) { wxLogError(_T("Failed to open '%s'"),filename.c_str()); + delete spectseq; return; } wxFileName path = wxFileName(filename); diff --git a/src/spectseq.cpp b/src/spectseq.cpp index c84fab24..d00a0cd1 100644 --- a/src/spectseq.cpp +++ b/src/spectseq.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 to 2007 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 * From 1e8175590e46d934592a17213b59cf53543b9dff Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 14:19:48 +0100 Subject: [PATCH 06/22] Delete spectseq on error conditions in VowelChartDir. --- src/vowelchart.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vowelchart.cpp b/src/vowelchart.cpp index e87d4e32..b9ba1e09 100644 --- a/src/vowelchart.cpp +++ b/src/vowelchart.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 to 2013 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 * @@ -225,6 +225,7 @@ static int VowelChartDir(wxDC *dc, wxBitmap *bitmap) if(stream.Ok() == FALSE) { path = wxFindNextFile(); + delete spectseq; continue; } spectseq->Load(stream); From 7afe4cf0bf6f2dfa0434ee48610e19fef5071f9c Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 14:28:55 +0100 Subject: [PATCH 07/22] Fix spect_data memory leak in SpectFrame::ImportSPC2 when nx is 0. --- src/spect.cpp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/spect.cpp b/src/spect.cpp index 2181e83d..493cb8d9 100644 --- a/src/spect.cpp +++ b/src/spect.cpp @@ -256,25 +256,33 @@ int SpectFrame::ImportSPC2(wxInputStream& stream, float &time_acc) if(cy.flags & 0x04) markers |= 8; - spect_data = new USHORT[nx]; - - if(spect_data == NULL) + if(nx>0) { - wxLogError(_T("Failed to allocate memory")); - return(1); - } + spect_data = new USHORT[nx]; - max_y = 0; - for(ix=0; ixdata[ix]; - if(spect_data[ix] > max_y) - max_y = spect_data[ix]; + if(spect_data == NULL) + { + wxLogError(_T("Failed to allocate memory")); + return(1); + } + + max_y = 0; + for(ix=0; ixdata[ix]; + if(spect_data[ix] > max_y) + max_y = spect_data[ix]; + } } - if(nx==0) + else { nx = int(8000/dx); spect_data = new USHORT[nx]; + if(spect_data == NULL) + { + wxLogError(_T("Failed to allocate memory")); + return(1); + } for(ix=0; ix Date: Sun, 4 Oct 2015 14:44:09 +0100 Subject: [PATCH 08/22] Guard usage of f_log in compile_dictlist_file. --- src/compiledict.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiledict.cpp b/src/compiledict.cpp index 4c389670..8bd83ec2 100644 --- a/src/compiledict.cpp +++ b/src/compiledict.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 * @@ -870,7 +871,8 @@ static int compile_dictlist_file(const char *path, const char* filename) return(-1); } - fprintf(f_log,"Compiling: '%s'\n",fname); + if(f_log != NULL) + fprintf(f_log,"Compiling: '%s'\n",fname); linenum=0; @@ -900,7 +902,8 @@ static int compile_dictlist_file(const char *path, const char* filename) count++; } - fprintf(f_log,"\t%d entries\n",count); + if(f_log != NULL) + fprintf(f_log,"\t%d entries\n",count); fclose(f_in); return(0); } /* end of compile_dictlist_file */ From be6ffd3449e444fcd8779d823f8791c72660bba7 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 14:53:02 +0100 Subject: [PATCH 09/22] 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) From ef7994f08460fd6578aadccfe50858a60b6613e7 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 14:56:58 +0100 Subject: [PATCH 10/22] 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); } From 72d8be8c8923ebb490349a6f6824ca36532f1188 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 15:01:10 +0100 Subject: [PATCH 11/22] Free f_logespeak in LoadConfig if it has already been loaded. --- src/synthdata.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/synthdata.cpp b/src/synthdata.cpp index 1cce9929..a90b9b2f 100644 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -495,7 +495,11 @@ void LoadConfig(void) if(memcmp(buf,"log",3)==0) { if(sscanf(&buf[4],"%d %s",&logging_type,string)==2) + { + if (f_logespeak) + fclose(f_logespeak); f_logespeak = fopen(string,"w"); + } } else if(memcmp(buf,"tone",4)==0) From 6722fdaca230f79904c25e61090c5c2b99add9ab Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 15:10:12 +0100 Subject: [PATCH 12/22] Free frame on error in SpectSeq::Load2. --- src/spectseq.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/spectseq.cpp b/src/spectseq.cpp index d00a0cd1..6e60e9fb 100644 --- a/src/spectseq.cpp +++ b/src/spectseq.cpp @@ -386,16 +386,28 @@ void SpectSeq::Load2(wxInputStream& stream, int import, int n) if(import==1) { - if(frame->Import(stream) != 0) break; + if(frame->Import(stream) != 0) + { + delete frame; + break; + } } else if(import==2) { - if(frame->ImportSPC2(stream,time_acc) != 0) break; + if(frame->ImportSPC2(stream,time_acc) != 0) + { + delete frame; + break; + } } else { - if(frame->Load(stream, file_format) != 0) break; + if(frame->Load(stream, file_format) != 0) + { + delete frame; + break; + } } frames[numframes++] = frame; From a77a4330ec034877fe16a741a84f13645aeebca5 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 15:33:29 +0100 Subject: [PATCH 13/22] Free f_in in VowelChartList on exit. --- src/vowelchart.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vowelchart.cpp b/src/vowelchart.cpp index b9ba1e09..b99408d0 100644 --- a/src/vowelchart.cpp +++ b/src/vowelchart.cpp @@ -329,6 +329,7 @@ static int VowelChartList(wxDC *dc, wxBitmap *bitmap, char *fname) filename.SetExt(_T("png")); bitmap->SaveFile(filename.GetFullPath(),wxBITMAP_TYPE_PNG); + fclose(f_in); return(count); } From 66eaac1d6c15da7750a960c04b525c23da514948 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 15:37:30 +0100 Subject: [PATCH 14/22] Free f_prog_log on error in MakeVowelLists. --- src/vowelchart.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vowelchart.cpp b/src/vowelchart.cpp index b99408d0..fefa671d 100644 --- a/src/vowelchart.cpp +++ b/src/vowelchart.cpp @@ -585,7 +585,10 @@ void MakeVowelLists(void) ix = GetFileLength(fname); prog_log_table = (PHONEME_PROG_LOG *)malloc(ix); if(prog_log_table == NULL) + { + fclose(f_prog_log); return; + } ix = fread(prog_log_table, 1, ix, f_prog_log); fclose(f_prog_log); n_prog_log = ix / sizeof(PHONEME_PROG_LOG); From ebd64d961b0fa5d96eea7847534f4941e781bd80 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 15:42:54 +0100 Subject: [PATCH 15/22] Fix a file leak in MakeVowelLists. --- src/vowelchart.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vowelchart.cpp b/src/vowelchart.cpp index fefa671d..738d3f20 100644 --- a/src/vowelchart.cpp +++ b/src/vowelchart.cpp @@ -609,7 +609,11 @@ void MakeVowelLists(void) // select the phoneme table by name // if(SetVoiceByName(phoneme_tab_list[table].name) != 0) continue; - if(SelectPhonemeTableName(phoneme_tab_list[table].name) < 0) continue; + if(SelectPhonemeTableName(phoneme_tab_list[table].name) < 0) + { + fclose(f); + continue; + } voice_found = 0; if((LoadVoice(phoneme_tab_list[table].name, 0) != NULL) && (translator->data_dictrules != NULL)) From 0b7a5a6ff196fb9e5ee1149a141cbe8b63dcd752 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 16:46:25 +0100 Subject: [PATCH 16/22] 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; From c39564c11f9aa6c2fb093ab826a453e93d43490e Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 16:48:42 +0100 Subject: [PATCH 17/22] Close f_in on error in CompileDictionary. --- src/compiledict.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiledict.cpp b/src/compiledict.cpp index 8bd83ec2..8873bfbf 100644 --- a/src/compiledict.cpp +++ b/src/compiledict.cpp @@ -1968,6 +1968,7 @@ int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, cha { if(fname_err) strcpy(fname_err,fname_out); + fclose(f_in); return(-1); } sprintf(fname_temp,"%s%ctemp",path_home,PATHSEP); From fd687c3162a604c98d98080bb3712a6779a130bd Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 16:53:34 +0100 Subject: [PATCH 18/22] 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); } From ae1a016e58df53281b64dce2193647ad40f3d99e Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 16:55:38 +0100 Subject: [PATCH 19/22] Close f_in on error in Lexicon_De. --- src/extras.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extras.cpp b/src/extras.cpp index dd225d51..3c07391d 100644 --- a/src/extras.cpp +++ b/src/extras.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2006 to 2011 by Jonathan Duddington * * email: jonsd@users.sourceforge.net * - * Copyright (C) 2013 by Reece H. Dunn * + * Copyright (C) 2013-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 * @@ -711,6 +711,7 @@ void Lexicon_De() if((f_out = fopen("compare_de","w")) == NULL) { wxLogError(_T("Can't write file ")); + fclose(f_out); return; } LoadVoice("de",0); From 01dc3357085c12c05f40d61ba97e1fc5575ef72e Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 16:56:51 +0100 Subject: [PATCH 20/22] Close f_in on error in Lexicon_It. --- src/extras.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extras.cpp b/src/extras.cpp index 3c07391d..6caa2ea8 100644 --- a/src/extras.cpp +++ b/src/extras.cpp @@ -369,6 +369,7 @@ void Lexicon_It(int pass) { str = wxString(buf, wxConvLocal); wxLogError(_T("Can't write file: ") + str); + fclose(f_in); return; } From 7dfbdb56ea4b561e7c6ef77ae9e5f779f18d13e3 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 17:01:26 +0100 Subject: [PATCH 21/22] Fix the logic in Lexicon_It to avoid leaking f_list_in when pass is not 1 or 2. --- src/extras.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extras.cpp b/src/extras.cpp index 6caa2ea8..ea942f10 100644 --- a/src/extras.cpp +++ b/src/extras.cpp @@ -384,7 +384,7 @@ void Lexicon_It(int pass) f_listx = fopen(buf,"w"); wxLogStatus(_T("Pass 1")); } - else + else if(pass == 2) { CompileDictionary(path_dsource,"it",NULL,NULL,0); sprintf(buf,"%s/it_listx2",path_dsource); From 910a4129ba6cee6b9be8a016f5e99363fd767280 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 4 Oct 2015 17:03:46 +0100 Subject: [PATCH 22/22] Free w_list in MakeWordFreqList on exit. --- src/extras.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extras.cpp b/src/extras.cpp index ea942f10..9f9a6e3f 100644 --- a/src/extras.cpp +++ b/src/extras.cpp @@ -1648,6 +1648,7 @@ void MakeWordFreqList() free(p); } fclose(f_out); + free(w_list); } // end of Make WorkFreqList