diff --git a/Plugins/sidplay/SidContainer.mm b/Plugins/sidplay/SidContainer.mm index 5f7f93506..eda2250c3 100644 --- a/Plugins/sidplay/SidContainer.mm +++ b/Plugins/sidplay/SidContainer.mm @@ -49,8 +49,10 @@ SidTune *tune = new SidTune((const uint_least8_t *)data, (uint_least32_t)size); - if(!tune->getStatus()) + if(!tune->getStatus()) { + delete tune; return 0; + } const SidTuneInfo *info = tune->getInfo(); diff --git a/Plugins/sidplay/SidMetadataReader.mm b/Plugins/sidplay/SidMetadataReader.mm index 9764aaffd..93d6fdd08 100644 --- a/Plugins/sidplay/SidMetadataReader.mm +++ b/Plugins/sidplay/SidMetadataReader.mm @@ -44,8 +44,10 @@ SidTune *tune = new SidTune((const uint_least8_t *)data, (uint_least32_t)size); - if(!tune->getStatus()) + if(!tune->getStatus()) { + delete tune; return 0; + } const SidTuneInfo *info = tune->getInfo(); @@ -54,6 +56,8 @@ NSString *titletag = info->songs() > 1 ? @"album" : @"title"; NSString *artist = count >= 2 ? [[NSString stringWithUTF8String:info->infoString(1)] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] : @""; + delete tune; + return @{titletag: title, @"artist": artist}; }