From: Vadim Zeitlin Date: Tue, 7 Mar 2006 23:21:08 +0000 (+0000) Subject: fixed memory leaks in case of errors during file load in wxSound::Create() (coverity... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/455f6b8d94e9e312e2c1a81a9515d784f9f4ac30?ds=sidebyside fixed memory leaks in case of errors during file load in wxSound::Create() (coverity checker CID 54) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/unix/sound.cpp b/src/unix/sound.cpp index 6afa44f146..04100babf9 100644 --- a/src/unix/sound.cpp +++ b/src/unix/sound.cpp @@ -467,12 +467,14 @@ bool wxSound::Create(const wxString& fileName, wxUint8 *data = new wxUint8[len]; if ( fileWave.Read(data, len) != lenOrig ) { + delete [] data; wxLogError(_("Couldn't load sound data from '%s'."), fileName.c_str()); return false; } if (!LoadWAV(data, len, false)) { + delete [] data; wxLogError(_("Sound file '%s' is in unsupported format."), fileName.c_str()); return false;