summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPreetam Singh Ranawat <apranawat@codeaurora.org>2019-06-24 15:11:28 +0530
committerKevin F. Haggerty <haggertk@lineageos.org>2020-01-25 09:27:38 -0700
commite56c4e48207d5aa04899f0d5e48f20494624c0dd (patch)
tree592bafc26f04cd19735659f8698955c7f852dc25
parent34d4a6ef31cb8fd7d17f2e30aec2e6fcfe3d7fea (diff)
downloadandroid_hardware_qcom_audio-cm-14.1-caf-8952.tar.gz
android_hardware_qcom_audio-cm-14.1-caf-8952.tar.bz2
android_hardware_qcom_audio-cm-14.1-caf-8952.zip
audio: free and assign NULL to global static device pointercm-14.1-caf-8952
-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 cbc3739e..e63df46b 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -3954,9 +3954,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);