Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2161a411 authored by Jayant Chowdhary's avatar Jayant Chowdhary Committed by Automerger Merge Worker
Browse files

Merge "CameraMetadata: avoid memory leak in case allocate_camera_metadata...

Merge "CameraMetadata: avoid memory leak in case allocate_camera_metadata fails." into sc-dev am: b18cfd46

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/14356828

Change-Id: Id962ec5f8116fbf0363cb7ea89831f2c19dfbc1e
parents 7eb3c872 b18cfd46
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -528,6 +528,8 @@ status_t CameraMetadata::resizeIfNeeded(size_t extraEntries, size_t extraData) {
            mBuffer = allocate_camera_metadata(newEntryCount,
                    newDataCount);
            if (mBuffer == NULL) {
                // Maintain old buffer to avoid potential memory leak.
                mBuffer = oldBuffer;
                ALOGE("%s: Can't allocate larger metadata buffer", __FUNCTION__);
                return NO_MEMORY;
            }