diff options
author | Preetam Singh Ranawat <apranawat@codeaurora.org> | 2019-06-24 15:11:28 +0530 |
---|---|---|
committer | Kevin F. Haggerty <haggertk@lineageos.org> | 2020-01-25 09:25:54 -0700 |
commit | 00bee237dad1476b0cb05d84fdc8c079d7200669 (patch) | |
tree | 28eabb5cd7d875b36072aeaf01427bd62607b436 | |
parent | 847eaa7d00bb80fbb8832d9016e0985774f21c2a (diff) | |
download | android_hardware_qcom_audio-cm-14.1-caf-8916.tar.gz android_hardware_qcom_audio-cm-14.1-caf-8916.tar.bz2 android_hardware_qcom_audio-cm-14.1-caf-8916.zip |
audio: free and assign NULL to global static device pointercm-14.1-caf-8916
-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index ec9b79d3..64b3b737 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); |