diff --git a/src/LoadModules.cpp b/src/LoadModules.cpp index b509af623..f76e4f130 100644 --- a/src/LoadModules.cpp +++ b/src/LoadModules.cpp @@ -237,8 +237,6 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler) wxString prefix = ::wxPathOnly(files[i]); ::wxSetWorkingDirectory(prefix); - Module *module = new Module(files[i]); - #ifdef EXPERIMENTAL_MODULE_PREFS if( !IsAllowedModule( files[i] ) ) // don't try and check the in-date-ness before this as that means loading the module to call it's GetVersionString, which could do anything. #endif EXPERIMENTAL_MODULE_PREFS @@ -254,6 +252,7 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler) continue; } + Module *module = new Module(files[i]); if (module->Load()) // it will get rejected if there are version problems { mInstance->mModules.Add(module); diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 0f7d396eb..26c512bca 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -184,7 +184,11 @@ bool Sequence::ConvertToSampleFormat(sampleFormat format, bool* pbChanged) bSuccess = (pOldBlockFile->ReadData(bufferOld, oldFormat, 0, len) > 0); if (!bSuccess) + { + DeleteSamples(bufferNew); + DeleteSamples(bufferOld); break; + } CopySamples(bufferOld, oldFormat, bufferNew, mSampleFormat, len); diff --git a/src/effects/ChangePitch.cpp b/src/effects/ChangePitch.cpp index 9c8a5fc17..993a20c33 100644 --- a/src/effects/ChangePitch.cpp +++ b/src/effects/ChangePitch.cpp @@ -117,6 +117,10 @@ void EffectChangePitch::DeduceFrequencies() for(j=1; j freqa[argmax]) argmax = j; + + delete [] freq; + delete [] freqa; + lag = (windowSize/2 - 1) - argmax; m_dStartFrequency = rate / lag; } diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index eea35cc1b..e3a4e6ff3 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -2675,6 +2675,9 @@ void EqualizationDialog::OnInvert(wxCommandEvent &event) // Inverts any curve mLogEnvelope->Move(when[i] , -value[i]); } + delete [] when; + delete [] value; + // copy it back to the other one (just in case) if(lin) EnvLinToLog(); diff --git a/src/export/ExportMP2.cpp b/src/export/ExportMP2.cpp index 04a0592b3..ceb9a5cd8 100644 --- a/src/export/ExportMP2.cpp +++ b/src/export/ExportMP2.cpp @@ -233,6 +233,7 @@ int ExportMP2::Export(AudacityProject *project, { wxMessageBox(_("Cannot export MP2 with this sample rate and bit rate"), _("Error"), wxICON_STOP); + twolame_close(&encodeOptions); return false; } @@ -243,6 +244,7 @@ int ExportMP2::Export(AudacityProject *project, FileIO outFile(fName, FileIO::Output); if (!outFile.IsOpened()) { wxMessageBox(_("Unable to open target file for writing")); + twolame_close(&encodeOptions); return false; } diff --git a/src/export/ExportPCM.cpp b/src/export/ExportPCM.cpp index 874234920..281d58e1b 100644 --- a/src/export/ExportPCM.cpp +++ b/src/export/ExportPCM.cpp @@ -596,7 +596,10 @@ char *ExportPCM::ConvertTo7bitASCII(const wxString wxStr) return NULL; char *pSrc = (char *)malloc(sr); if (!pSrc) + { + free(pDest); return NULL; + } memset(pDest, 0, sr); memset(pSrc, 0, sr);