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:37:44 -0700
commite38512db04a81c44c0cbf6c7d6a29851e9c2cb2d (patch)
tree9b2b0480b6aea9e144402655e9f0564e51b0393e
parentdee2005505d24d2298149acc5a473bb33740e0e7 (diff)
downloadandroid_hardware_qcom_audio-lineage-16.0-caf-8974.tar.gz
android_hardware_qcom_audio-lineage-16.0-caf-8974.tar.bz2
android_hardware_qcom_audio-lineage-16.0-caf-8974.zip
audio: free and assign NULL to global static device pointerlineage-16.0-caf-8974
-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);