OSDN Git Service

Fix potential leak of audio input handle.
authorJeff Brown <jeffbrown@google.com>
Sat, 10 Aug 2013 01:32:30 +0000 (18:32 -0700)
committerJeff Brown <jeffbrown@google.com>
Sat, 10 Aug 2013 02:57:53 +0000 (19:57 -0700)
commitac0bbe16f3eba46b3d8057b66c2aff9101fc6f7d
tree14008bb60b6b0ac3eb77b8e39504400d2b446e43
parent1b832c3d8f2b1b24f9bc7025afd2b4a8b4e6c6f9
Fix potential leak of audio input handle.

The audio input handle is ultimately owned by the audio recorder
object but it could be dropped on the floor if an error occurred
before that object was fully initialized.

Rearranged some of the argument validation and merged getInput_l
with openRecord_l to simplify the code and prevent such a leak
from occurring.

Bug: 10265163
Change-Id: I124dce344b1d11c2dd66ca5e2c9aec0c52c230e2
include/media/AudioRecord.h
media/libmedia/AudioRecord.cpp