]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed memory leaks in case of errors during file load in wxSound::Create() (coverity...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:21:08 +0000 (23:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:21:08 +0000 (23:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/sound.cpp

index 6afa44f146d97c5336f01c5b38dbc04c130659fa..04100babf99c0b97067341227f3448afcce93446 100644 (file)
@@ -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;