[PATCH V2] event: assert wl_event_source pointer is NULL.

Hardening rdp.effort at gmail.com
Mon May 12 01:09:46 PDT 2014


Le 12/05/2014 07:56, Srivardhan Hebbar a écrit :
> Signed-off-by: Srivardhan Hebbar <sri.hebbar at samsung.com>
> ---
>   src/event-loop.c |    6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/event-loop.c b/src/event-loop.c
> index 9790cde..57e3fed 100644
> --- a/src/event-loop.c
> +++ b/src/event-loop.c
> @@ -312,7 +312,11 @@ wl_event_source_check(struct wl_event_source *source)
>   WL_EXPORT int
>   wl_event_source_remove(struct wl_event_source *source)
>   {
> -	struct wl_event_loop *loop = source->loop;
> +	struct wl_event_loop *loop;
> +
> +	assert(!source);

Isn't it the opposite ?

> +
> +	loop = source->loop;
>
>   	/* We need to explicitly remove the fd, since closing the fd
>   	 * isn't enough in case we've dup'ed the fd. */
>

Regards
-- 
David FORT
website: http://www.hardening-consulting.com/


More information about the wayland-devel mailing list