AudioFlinger: delete Track object when createTrack() fails due to lack of tracks in AudioMixer.
This problem was encountered as a side effect of issue 2245298.
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index 230e833..ebd470f 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -1018,7 +1018,7 @@
Mutex::Autolock _l(mLock);
track = new Track(this, client, streamType, sampleRate, format,
channelCount, frameCount, sharedBuffer);
- if (track->getCblk() == NULL) {
+ if (track->getCblk() == NULL || track->name() < 0) {
lStatus = NO_MEMORY;
goto Exit;
}