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:47 +0200
commit8a808922fda3ace039adc84c01864ad71daa15b7 (patch)
tree0ad70b9d2749aa3de6d09fe4da9549fdf008ffb8
parent034e4c6606e53eef822e53c187c4b77984c03726 (diff)
downloadandroid_hardware_qcom_audio-lineage-17.1-caf-msm8974.tar.gz
android_hardware_qcom_audio-lineage-17.1-caf-msm8974.tar.bz2
android_hardware_qcom_audio-lineage-17.1-caf-msm8974.zip
audio: free and assign NULL to global static device pointerlineage-17.1-caf-msm8974
-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 0d640635..8fb77e18 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -3718,9 +3718,9 @@ static int adev_verify_devices(struct audio_device *adev)
static int adev_close(hw_device_t *device)
{
size_t i;
- 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);