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-13 07:34:02 -0700 |
commit | 837e30800a6ec85809d7e2356d4098fbef9f7d3d (patch) | |
tree | 2a95660b57cf99ea191cdb4ebb04238972a5fa3d | |
parent | 69f1dbade56912d89af41aa65594f7ac2a16d259 (diff) | |
download | android_hardware_qcom_audio-lineage-16.0-caf-8960.tar.gz android_hardware_qcom_audio-lineage-16.0-caf-8960.tar.bz2 android_hardware_qcom_audio-lineage-16.0-caf-8960.zip |
audio: free and assign NULL to global static device pointerlineage-16.0-caf-8960
-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 75eeb049..25826a97 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -3300,9 +3300,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); |