diff options
| author | Preetam Singh Ranawat <apranawat@codeaurora.org> | 2019-06-24 15:11:28 +0530 |
|---|---|---|
| committer | Han Wang <416810799@qq.com> | 2020-01-16 11:44:08 +0200 |
| commit | a729b638be235e98416c067c4fdb626e2a3f27fc (patch) | |
| tree | 3cb41a80a113b99dd807b4414f4b4dafd8d55d02 | |
| parent | 3e3cfe0e848dea87d9b8ba3f6ead0082c7c539b9 (diff) | |
| download | android_hardware_qcom_audio-lineage-17.1-caf-msm8916.tar.gz android_hardware_qcom_audio-lineage-17.1-caf-msm8916.tar.bz2 android_hardware_qcom_audio-lineage-17.1-caf-msm8916.zip | |
audio: free and assign NULL to global static device pointerlineage-17.1-caf-msm8916
-free and assign NULL to global static device pointer instead of local
pointer to avoid free after use issue.
Change-Id: Idfdef719320efcd792c7d2ebd7ec2dfe5d3fbfbd
(cherry picked from commit 6676b869284a8718f037def628eae1329b36ac20)
| -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 74786043..4cc1f3d1 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -3906,9 +3906,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); |
