Subject: Re: [PATCH 2/2] http.c: avoid gcc warning

From: Junio C Hamano <[email-masked]>
Date: Fri, 06 May 2022 13:22:59 -0700

Michael J Gruber <[email-masked]> writes:

See previous discussion on the topic and help clarify it for me,
thanks.

https://lore.kernel.org/git/[email-masked]/

> Related to -Wdangling-pointer.
>
> In fact, this use of the pointer looks scary and has not created
> problems so far only because the pointer in the struct is not used when
> execution is out of the scope of the local function (and the pointer
> invalid).
>
> Signed-off-by: Michael J Gruber <[email-masked]>
> ---
>  http.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/http.c b/http.c
> index 229da4d148..2f67fbb33c 100644
> --- a/http.c
> +++ b/http.c
> @@ -1367,6 +1367,7 @@ void run_active_slot(struct active_request_slot *slot)
>  			select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout);
>  		}
>  	}
> +	slot->finished = NULL;
>  }
>  
>  static void release_active_slot(struct active_request_slot *slot)