summaryrefslogtreecommitdiff
path: root/userland/httpd/httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'userland/httpd/httpd.c')
-rw-r--r--userland/httpd/httpd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/userland/httpd/httpd.c b/userland/httpd/httpd.c
index 845355a..aeae6aa 100644
--- a/userland/httpd/httpd.c
+++ b/userland/httpd/httpd.c
@@ -107,9 +107,11 @@ void parse_incoming_request(struct http_request *request) {
return;
}
- char *p = SV_TO_C(path);
- request->file_fd = open(p, O_RDONLY);
- free(p);
+ {
+ char path_buffer[256];
+ sv_to_cstring_buffer(path, path_buffer, 256);
+ request->file_fd = open(path_buffer, O_RDONLY);
+ }
if (-1 == request->file_fd) {
request->status_code = 404;
return;