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

Commit e8278ac8 authored by Manoj Gupta's avatar Manoj Gupta
Browse files

Fix clang static analyzer warnings.

Fix the following warning:
Potential leak of memory pointed to by 'b'
[clang-analyzer-cplusplus.NewDeleteLeaks]

Bug: b/27101951
Test:Warning is gone.
Change-Id: If898bae71771f325c97777a19af0c0cf2e8a0400
parent a97d58a2
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include <utils/Mutex.h>
#include <utils/Condition.h>

#include <vector>
#define CPU_CONSUMER_TEST_FORMAT_RAW 0
#define CPU_CONSUMER_TEST_FORMAT_Y8 0
#define CPU_CONSUMER_TEST_FORMAT_Y16 0
@@ -635,7 +636,7 @@ TEST_P(CpuConsumerTest, FromCpuLockMax) {

    // Consume

    CpuConsumer::LockedBuffer *b = new CpuConsumer::LockedBuffer[params.maxLockedBuffers];
    std::vector<CpuConsumer::LockedBuffer> b(params.maxLockedBuffers);
    for (int i = 0; i < params.maxLockedBuffers; i++) {
        ALOGV("Locking frame %d", i);
        err = mCC->lockNextBuffer(&b[i]);
@@ -684,9 +685,6 @@ TEST_P(CpuConsumerTest, FromCpuLockMax) {
    for (int i = 1; i < params.maxLockedBuffers; i++) {
        mCC->unlockBuffer(b[i]);
    }

    delete[] b;

}

CpuConsumerTestParams y8TestSets[] = {