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-13 07:35:08 -0700
commit55efc744292bd69a8874c2c61997762397c13057 (patch)
tree9cc233bc12450793603d368c83a99619c76d2434
parent6a6bc540024b2397eed14835deb6774898f0fc5d (diff)
downloadandroid_hardware_qcom_audio-lineage-16.0-caf-845.tar.gz
android_hardware_qcom_audio-lineage-16.0-caf-845.tar.bz2
android_hardware_qcom_audio-lineage-16.0-caf-845.zip
audio: free and assign NULL to global static device pointerlineage-16.0-caf-845
-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 13dd4a0e..977ad616 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -7584,9 +7584,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);