From ed564ae329c0a5bdb768aeb85f6785d8953a5f56 Mon Sep 17 00:00:00 2001 From: Preetam Singh Ranawat Date: Mon, 24 Jun 2019 15:11:28 +0530 Subject: audio: free and assign NULL to global static device pointer -free and assign NULL to global static device pointer instead of local pointer to avoid free after use issue. Change-Id: Idfdef719320efcd792c7d2ebd7ec2dfe5d3fbfbd --- hal/audio_hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hal/audio_hw.c b/hal/audio_hw.c index c82ba349..d69462a1 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -3657,9 +3657,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); -- cgit v1.2.3