summaryrefslogtreecommitdiff
path: root/android/hal-audio.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-01-31 16:18:46 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-02-02 07:43:52 -0800
commitd8beaba79f149204ba9b1c8e845816a2fd1ba9ef (patch)
tree6a7f091df4744d111d0d016573b1e47f549d8e9a /android/hal-audio.c
parent905815f4a1d29d0b113cb3e297a5919393e15b4a (diff)
downloadbluez-d8beaba79f149204ba9b1c8e845816a2fd1ba9ef.tar.gz
android/hal-audio: Check calloc return value
calloc() might return NULL and is usually checked for NULL in BlueZ.
Diffstat (limited to 'android/hal-audio.c')
-rw-r--r--android/hal-audio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/android/hal-audio.c b/android/hal-audio.c
index b1323b0b4..35bafe77e 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -313,6 +313,8 @@ static int sbc_codec_init(struct audio_preset *preset, uint16_t mtu,
}
sbc_data = calloc(sizeof(struct sbc_data), 1);
+ if (!sbc_data)
+ return AUDIO_STATUS_FAILED;
memcpy(&sbc_data->sbc, preset->data, preset->len);