From b3ee1209a3d09ef56073bf5c1f999d7281fa27fb Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 31 Jan 2026 14:40:20 +0100 Subject: [PATCH] uclient-http: reset fd to -1 after close in disconnect Ensure the file descriptor field is invalidated after closing to prevent potential use of stale fd values. Signed-off-by: Felix Fietkau --- uclient-http.c | 1 + 1 file changed, 1 insertion(+) diff --git a/uclient-http.c b/uclient-http.c index f00cbe5..5de7924 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -155,6 +155,7 @@ static void uclient_http_disconnect(struct uclient_http *uh) ustream_free(&uh->ufd.stream); if(uh->fd >= 0) close(uh->fd); + uh->fd = -1; uh->us = NULL; } -- 2.30.2