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

Commit d8cd4779 authored by soon1.choi's avatar soon1.choi Committed by Soon-won Choi
Browse files

fix memory leak in PatchPanel

Before the audio patch is created, audio patch with same handle is
removed from vector for patches. At this time, Patch allocated in the
heap is not freed. This causes memory leaks in the mediaserver.

Change-Id: Id0d28c36a7e7fbf473753bf4ead7518f28c1b998
parent bd08223c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -166,7 +166,9 @@ status_t AudioFlinger::PatchPanel::createAudioPatch(const struct audio_patch *pa
            if (*handle == mPatches[index]->mHandle) {
                ALOGV("createAudioPatch() removing patch handle %d", *handle);
                halHandle = mPatches[index]->mHalHandle;
                Patch *removedPatch = mPatches[index];
                mPatches.removeAt(index);
                delete removedPatch;
                break;
            }
        }