diff options
author | soon1.choi <soon1.choi@lge.com> | 2015-01-05 14:27:42 +0900 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-01-05 15:34:15 -0800 |
commit | e443ffac2a09b69470c4663ee031a527c53738d9 (patch) | |
tree | 7db596e90207472c7ff018f4778d16de8c806e62 /services/audioflinger | |
parent | 0d19abb440c7e62e944efbeadf02299990f9a589 (diff) | |
download | frameworks_av-e443ffac2a09b69470c4663ee031a527c53738d9.zip frameworks_av-e443ffac2a09b69470c4663ee031a527c53738d9.tar.gz frameworks_av-e443ffac2a09b69470c4663ee031a527c53738d9.tar.bz2 |
DO NOT MERGE - 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.
Bug: 18904322.
Change-Id: Id0d28c36a7e7fbf473753bf4ead7518f28c1b998
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/PatchPanel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/services/audioflinger/PatchPanel.cpp b/services/audioflinger/PatchPanel.cpp index 7544052..4f0c6b1 100644 --- a/services/audioflinger/PatchPanel.cpp +++ b/services/audioflinger/PatchPanel.cpp @@ -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; } } |