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:30:25 -0700 |
commit | 026b16f70f1d375acfe886b97da700e352fc2c3a (patch) | |
tree | 293933fc3b577a3aeeb8b2f07d7c43f1ccb16db2 | |
parent | 074553a58ef291158a3261974ebed128bd5a16dd (diff) | |
download | android_hardware_qcom_audio-cm-14.1-caf-8998.tar.gz android_hardware_qcom_audio-cm-14.1-caf-8998.tar.bz2 android_hardware_qcom_audio-cm-14.1-caf-8998.zip |
audio: free and assign NULL to global static device pointercm-14.1-caf-8998
-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 05bd3c8c..26107ff7 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -5293,9 +5293,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); |