summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-22 17:44:23 +0200
committerdefault <nobody@localhost>2022-09-22 17:44:23 +0200
commit7a60c71744f94edc66994537fddafaf0db594fb5 (patch)
tree2ed951c75f08ffd3c1c30e02347536ae68dd975f /httpd.c
parentb8436ddfde4f26ece7cc3a442f05d44cb999118d (diff)
Fixed memleak in greeting.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/httpd.c b/httpd.c
index 8e798a4..18a9d6e 100644
--- a/httpd.c
+++ b/httpd.c
@@ -41,6 +41,7 @@ void server_get_handler(d_char *req, char *q_path, int *status,
xs *list = user_list();
char *p, *uid;
xs *ul = xs_str_new("<ul class=\"snac-user-list\">\n");
+ xs *os = s;
p = list;
while (xs_list_iter(&p, &uid)) {
@@ -60,7 +61,7 @@ void server_get_handler(d_char *req, char *q_path, int *status,
ul = xs_str_cat(ul, "</ul>\n");
- s = xs_replace(s, "%userlist%", ul);
+ s = xs_replace(os, "%userlist%", ul);
}
*body = s;