plug some memory leaks in server_file_index when failures occur
authorop <op@openbsd.org>
Mon, 15 Aug 2022 09:40:14 +0000 (09:40 +0000)
committerop <op@openbsd.org>
Mon, 15 Aug 2022 09:40:14 +0000 (09:40 +0000)
commit896eaea55aa0c9d92c3587ca21f11fa430e8d0fb
treee357d06590c0e1b09ca63ce7d246a9e2f07f3088
parentdabb292335db8bf08f01d618bdfe739077955391
plug some memory leaks in server_file_index when failures occur

namelist and its entries are not freed if escape_html fails or if we
fail in the inner loop.  Move scandir later so it's closer to the for
loop and handle escape_html and url_encode failures.

With lots of help from tb, thanks!

ok tb@
usr.sbin/httpd/server_file.c