[Libguestfs] [PATCH 09/13] syntax-check: fix prohibit_path_max_allocation check

Pino Toscano ptoscano at redhat.com
Tue Sep 23 14:00:54 UTC 2014


On Tuesday 23 September 2014 17:20:35 Hu Tao wrote:
> Signed-off-by: Hu Tao <hutao at cn.fujitsu.com>
> ---
>  daemon/inotify.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

While I'd personally get rid of PATH_MAX at all, I understand the Linux 
inotify implementation relies on it...

> 
> diff --git a/daemon/inotify.c b/daemon/inotify.c
> index 36e5ede..b847b7d 100644
> --- a/daemon/inotify.c
> +++ b/daemon/inotify.c
> @@ -309,7 +309,7 @@ do_inotify_files (void)
>    unsigned int i;
>    FILE *fp = NULL;
>    guestfs_int_inotify_event_list *events;
> -  char buf[PATH_MAX];
> +  char *buf = NULL;

Make it CLEANUP_FREE, so you don't need to manually free it later (and 
gets freed in every exit point of the function).

-- 
Pino Toscano




More information about the Libguestfs mailing list