From 7426ec8e7853943dc571db9b60d89c849589beb3 Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Wed, 11 Sep 2019 14:34:27 -0700 Subject: BootAnimation: Avoid memory leak in error case If we fail preloadZip(), we release the animation prior to returning. Test: TreeHugger Change-Id: I632c052ef22b2a7192b516de5726bf4e74544f7a --- cmds/bootanimation/BootAnimation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'cmds/bootanimation/BootAnimation.cpp') diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index e1cb7ca6a697..a5aa531fe6f8 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -1157,6 +1157,7 @@ BootAnimation::Animation* BootAnimation::loadAnimation(const String8& fn) parseAnimationDesc(*animation); if (!preloadZip(*animation)) { + releaseAnimation(animation); return nullptr; } -- cgit v1.2.3-59-g8ed1b