diff options
author | Matt Wagantall <mwagantall@cyngn.com> | 2016-02-26 16:58:56 -0800 |
---|---|---|
committer | Matt Wagantall <mwagantall@cyngn.com> | 2016-02-26 16:59:33 -0800 |
commit | 09eeea9f7342de46df1a539a9ef846a13c34a765 (patch) | |
tree | 63d20157bbba053e53dfb8e1df2b1871a6ce0f4d | |
parent | 24c39c0d3734f99d8cf5ea4b925908e5303dd538 (diff) | |
parent | 692a5cc958012f4d754ab20fcec36e35e1d3ebdd (diff) | |
download | hardware_qcom_audio-09eeea9f7342de46df1a539a9ef846a13c34a765.tar.gz hardware_qcom_audio-09eeea9f7342de46df1a539a9ef846a13c34a765.tar.bz2 hardware_qcom_audio-09eeea9f7342de46df1a539a9ef846a13c34a765.zip |
Merge tag 'LA.BF64.1.2.2-03340-8x94.0' into HEADstable/cm-13.0-caf-8994-ZNH2KB
"LA.BF64.1.2.2-03340-8x94.0"
Issue-Id: SAMBAR-1290
Change-Id: I3a8cb0e2785a2a98a86871cfc5fe7d575ea86305
-rw-r--r-- | hal/audio_extn/utils.c | 6 | ||||
-rw-r--r-- | hal/audio_hw.c | 26 |
2 files changed, 29 insertions, 3 deletions
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c index 56b7f463..32cdcc85 100644 --- a/hal/audio_extn/utils.c +++ b/hal/audio_extn/utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright (C) 2014 The Android Open Source Project @@ -351,6 +351,7 @@ void audio_extn_utils_update_streams_output_cfg_list(void *platform, root = config_node("", ""); if (root == NULL) { ALOGE("cfg_list, NULL config root"); + free(data); return; } @@ -358,6 +359,9 @@ void audio_extn_utils_update_streams_output_cfg_list(void *platform, load_output(root, platform, streams_output_cfg_list); send_app_type_cfg(platform, mixer, streams_output_cfg_list); + + config_free(root); + free(data); } void audio_extn_utils_dump_streams_output_cfg_list( diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 998954cc..7aa34ca2 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright (C) 2013 The Android Open Source Project @@ -2125,7 +2125,7 @@ static char* out_get_parameters(const struct audio_stream *stream, const char *k { struct stream_out *out = (struct stream_out *)stream; struct str_parms *query = str_parms_create_str(keys); - char *str; + char *str = (char*) NULL; char value[256]; struct str_parms *reply = str_parms_create(); size_t i, j; @@ -2133,6 +2133,12 @@ static char* out_get_parameters(const struct audio_stream *stream, const char *k bool first = true; if (!query || !reply) { + if (reply) { + str_parms_destroy(reply); + } + if (query) { + str_parms_destroy(query); + } ALOGE("out_get_parameters: failed to allocate mem for query or reply"); return NULL; } @@ -2178,6 +2184,8 @@ static char* out_get_parameters(const struct audio_stream *stream, const char *k strlcat(value, "false", sizeof(value)); } str_parms_add_str(reply, "is_direct_pcm_track", value); + if (str) + free(str); str = str_parms_to_str(reply); } @@ -2200,6 +2208,8 @@ static char* out_get_parameters(const struct audio_stream *stream, const char *k i++; } str_parms_add_str(reply, AUDIO_PARAMETER_STREAM_SUP_FORMATS, value); + if (str) + free(str); str = str_parms_to_str(reply); } str_parms_destroy(query); @@ -2767,6 +2777,12 @@ static char* in_get_parameters(const struct audio_stream *stream, struct str_parms *reply = str_parms_create(); if (!query || !reply) { + if (reply) { + str_parms_destroy(reply); + } + if (query) { + str_parms_destroy(query); + } ALOGE("in_get_parameters: failed to create query or reply"); return NULL; } @@ -3493,6 +3509,12 @@ static char* adev_get_parameters(const struct audio_hw_device *dev, int ret = 0; if (!query || !reply) { + if (reply) { + str_parms_destroy(reply); + } + if (query) { + str_parms_destroy(query); + } ALOGE("adev_get_parameters: failed to create query or reply"); return NULL; } |