Thread (1 message) 1 message, 1 author, 2022-05-06

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

From: Junio C Hamano <hidden>
Date: 2022-05-06 20:23:09

Michael J Gruber [off-list ref] writes:

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

https://lore.kernel.org/git/xmqqo8131tr8.fsf@gitster.g/ (local)
quoted hunk
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 <redacted>
---
 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)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help