summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsoon1.choi <soon1.choi@lge.com>2015-01-05 14:27:42 +0900
committerEric Laurent <elaurent@google.com>2015-01-05 15:34:15 -0800
commite443ffac2a09b69470c4663ee031a527c53738d9 (patch)
tree7db596e90207472c7ff018f4778d16de8c806e62
parent0d19abb440c7e62e944efbeadf02299990f9a589 (diff)
downloadframeworks_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
-rw-r--r--services/audioflinger/PatchPanel.cpp2
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;
}
}