diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2014-01-31 16:18:48 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-02-02 07:43:52 -0800 |
commit | 69a8e1c3fb14f14699798665f38fbf6d517f2cf7 (patch) | |
tree | 2f432db7bf0a6b9900ed64df82a1eddf2141e564 /android/hal-audio.c | |
parent | 014471cae859a34591dd1f768712aaf14788ebd2 (diff) | |
download | bluez-69a8e1c3fb14f14699798665f38fbf6d517f2cf7.tar.gz |
android/hal-audio: Fix memory leak
Free preset if set_blocking() fails.
Diffstat (limited to 'android/hal-audio.c')
-rw-r--r-- | android/hal-audio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/android/hal-audio.c b/android/hal-audio.c index a6347afea..a2601fd48 100644 --- a/android/hal-audio.c +++ b/android/hal-audio.c @@ -1179,8 +1179,10 @@ static int audio_open_output_stream(struct audio_hw_device *dev, if (!preset || fd < 0) goto fail; - if (set_blocking(fd) < 0) + if (set_blocking(fd) < 0) { + free(preset); goto fail; + } out->ep->fd = fd; codec = out->ep->codec; |