diff mbox series

iio: event_monitor: Fix missing free in main

Message ID 20240904080533.104279-1-zhangjiao2@cmss.chinamobile.com (mailing list archive)
State Accepted
Headers show
Series iio: event_monitor: Fix missing free in main | expand

Commit Message

zhangjiao2 Sept. 4, 2024, 8:05 a.m. UTC
From: zhang jiao <zhangjiao2@cmss.chinamobile.com>

Free string allocated by asprintf().

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
---
 tools/iio/iio_event_monitor.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jonathan Cameron Sept. 7, 2024, 3:45 p.m. UTC | #1
On Wed,  4 Sep 2024 16:05:33 +0800
zhangjiao2 <zhangjiao2@cmss.chinamobile.com> wrote:

> From: zhang jiao <zhangjiao2@cmss.chinamobile.com>
> 
> Free string allocated by asprintf().
> 
> Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
Applied, but probably now 6.13 material

Thanks,

Jonathan

> ---
>  tools/iio/iio_event_monitor.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
> index 8073c9e4fe46..d0b8e484826d 100644
> --- a/tools/iio/iio_event_monitor.c
> +++ b/tools/iio/iio_event_monitor.c
> @@ -449,6 +449,7 @@ int main(int argc, char **argv)
>  		enable_events(dev_dir_name, 0);
>  
>  	free(chrdev_name);
> +	free(dev_dir_name);
>  
>  	return ret;
>  }
diff mbox series

Patch

diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
index 8073c9e4fe46..d0b8e484826d 100644
--- a/tools/iio/iio_event_monitor.c
+++ b/tools/iio/iio_event_monitor.c
@@ -449,6 +449,7 @@  int main(int argc, char **argv)
 		enable_events(dev_dir_name, 0);
 
 	free(chrdev_name);
+	free(dev_dir_name);
 
 	return ret;
 }