[PATCH xf86-input-libinput] Initialize variable 'path' to NULL to silence warning

Peter Hutterer peter.hutterer at who-t.net
Thu Mar 5 20:52:17 PST 2015


On Fri, Mar 06, 2015 at 10:22:15AM +0800, Boyan Ding wrote:
>   CC       libinput.lo
> libinput.c: In function 'xf86libinput_pre_init':
> libinput.c:1222:2: warning: 'path' may be used uninitialized in this
> function [-Wmaybe-uninitialized]
>   free(path);
>   ^
> 
> Signed-off-by: Boyan Ding <boyan.j.ding at gmail.com>

pushed, thanks.

   7ec0bf7..4ac531b  master -> master

Cheers,
   Peter

> ---
>  src/libinput.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libinput.c b/src/libinput.c
> index 5e616c8..56b93d6 100644
> --- a/src/libinput.c
> +++ b/src/libinput.c
> @@ -1177,7 +1177,7 @@ xf86libinput_pre_init(InputDriverPtr drv,
>  	struct xf86libinput *driver_data = NULL;
>          struct libinput *libinput = NULL;
>  	struct libinput_device *device;
> -	char *path;
> +	char *path = NULL;
>  
>  	pInfo->type_name = 0;
>  	pInfo->device_control = xf86libinput_device_control;
> -- 
> 2.3.0


More information about the xorg-devel mailing list