BootAnimation: Avoid memory leak in error case

If we fail preloadZip(), we release the animation prior to
returning.

Test: TreeHugger
Change-Id: I632c052ef22b2a7192b516de5726bf4e74544f7a
This commit is contained in:
Greg Kaiser
2019-09-11 14:34:27 -07:00
parent 0b97592811
commit 7426ec8e78

View File

@@ -1157,6 +1157,7 @@ BootAnimation::Animation* BootAnimation::loadAnimation(const String8& fn)
parseAnimationDesc(*animation);
if (!preloadZip(*animation)) {
releaseAnimation(animation);
return nullptr;
}