summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPreetam Singh Ranawat <apranawat@codeaurora.org>2019-06-24 15:11:28 +0530
committerHan Wang <416810799@qq.com>2020-01-16 11:44:25 +0200
commitbc2d95118e5b4b5851b7d785e64b26c95bc4e091 (patch)
treee91377580c097f8bc699c7503e0a1decae7cc9bd
parent1c17a8f7d52293170d0b53761593184c6c9b037b (diff)
downloadandroid_hardware_qcom_audio-lineage-17.1-caf-msm8952.tar.gz
android_hardware_qcom_audio-lineage-17.1-caf-msm8952.tar.bz2
android_hardware_qcom_audio-lineage-17.1-caf-msm8952.zip
audio: free and assign NULL to global static device pointerlineage-17.1-caf-msm8952
-free and assign NULL to global static device pointer instead of local pointer to avoid free after use issue. Change-Id: Idfdef719320efcd792c7d2ebd7ec2dfe5d3fbfbd
-rw-r--r--hal/audio_hw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index bd4eda86..c65f970a 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -3904,9 +3904,9 @@ static int adev_dump(const audio_hw_device_t *device __unused,
static int adev_close(hw_device_t *device)
{
- struct audio_device *adev = (struct audio_device *)device;
+ struct audio_device *adev_temp = (struct audio_device *)device;
- if (!adev)
+ if (!adev_temp)
return 0;
pthread_mutex_lock(&adev_init_lock);