diff options
| author | 2019-09-11 14:34:27 -0700 | |
|---|---|---|
| committer | 2019-12-03 07:37:52 -0800 | |
| commit | 7426ec8e7853943dc571db9b60d89c849589beb3 (patch) | |
| tree | 81e488472ad217863994605398c97d134321c092 /cmds/bootanimation/BootAnimation.cpp | |
| parent | 0b975928115ca80f4dfb33c9f0418b593d1472c0 (diff) | |
BootAnimation: Avoid memory leak in error case
If we fail preloadZip(), we release the animation prior to
returning.
Test: TreeHugger
Change-Id: I632c052ef22b2a7192b516de5726bf4e74544f7a
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
| -rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |