From 455f6b8d94e9e312e2c1a81a9515d784f9f4ac30 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Mar 2006 23:21:08 +0000 Subject: [PATCH] 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 --- src/unix/sound.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.45.2