nuttx-apps/netutils/thttpd
Nightt 8568013436 netutils/thttpd: Apply the same check to related allocation sites
Extend the allocation-failure check to httpd_strdup(), the thttpd-local wrapper that has the same failure contract as strdup().

This is logically separable from the direct strdup()/asprintf() fixes: it prevents using hs->hostname before checking whether the wrapped string allocation succeeded, and releases the partially allocated server state on failure.

The scope intentionally does not extend to malloc(), calloc(), or other raw allocators because #1727 specifically calls out strdup()/asprintf(), and covering all allocation APIs would make this PR much broader.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-23 16:30:52 -04:00
..
cgi-src
.gitignore
CMakeLists.txt
config.h
fdwatch.c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
fdwatch.h
Kconfig
libhttpd.c netutils/thttpd: Apply the same check to related allocation sites 2026-05-23 16:30:52 -04:00
libhttpd.h
Make.defs
Makefile
mime_types.h
tdate_parse.c !apps: replace sclock_t with clock_t and drop redundant time_t/off_t casts 2026-05-11 17:38:32 +08:00
tdate_parse.h
thttpd.c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
thttpd_alloc.c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
thttpd_alloc.h
thttpd_cgi.c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
thttpd_cgi.h
thttpd_strings.c
thttpd_strings.h
timers.c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
timers.h