summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2026-01-31 13:40:20 +0000
committerFelix Fietkau2026-01-31 13:40:20 +0000
commitb3ee1209a3d09ef56073bf5c1f999d7281fa27fb (patch)
tree1446ecdb76656266383635db8306819ef17cc7c7
parentdc909ca71bc884c0e5362e1d7cc7808696cb2add (diff)
downloaduclient-b3ee1209a3d09ef56073bf5c1f999d7281fa27fb.tar.gz
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 <nbd@nbd.name>
-rw-r--r--uclient-http.c1
1 files changed, 1 insertions, 0 deletions
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;
}