CID 611239: Fix resource leak

This commit is contained in:
Philippe Saint-Pierre
2012-07-20 21:50:13 -04:00
parent 902a98ad83
commit 2d5785ba12
+4 -1
View File
@@ -361,8 +361,11 @@ BSoundFile::_ref_to_file(const entry_ref *ref)
raw = &mf.u.raw_audio;
}
if (raw == NULL)
if (raw == NULL) {
delete media;
delete file;
return B_ERROR;
}
fSamplingRate = (int)raw->frame_rate;
fChannelCount = raw->channel_count;