diff options
author | default <nobody@localhost> | 2022-10-25 13:59:15 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2022-10-25 13:59:15 +0200 |
commit | 78b3a304479ac3063bf75d41ed25539ed474763d (patch) | |
tree | 5d561ec56847a8c4714b304d43d3ed4999439535 /httpd.c | |
parent | 641d46cb3dba6fb2671644485189b6efd8082949 (diff) |
Some code moving to avoid false positive leaks.
Diffstat (limited to 'httpd.c')
-rw-r--r-- | httpd.c | 29 |
1 files changed, 15 insertions, 14 deletions
@@ -183,10 +183,8 @@ void httpd_connection(FILE *f) b_size = strlen(body); /* if it was a HEAD, no body will be sent */ - if (strcmp(method, "HEAD") == 0) { - free(body); - body = NULL; - } + if (strcmp(method, "HEAD") == 0) + body = xs_free(body); xs_httpd_response(f, status, headers, body, b_size); @@ -194,7 +192,7 @@ void httpd_connection(FILE *f) srv_archive("RECV", req, payload, p_size, status, headers, body, b_size); - free(body); + xs_free(body); } @@ -233,18 +231,21 @@ static void *queue_thread(void *arg) srv_log(xs_fmt("queue thread start")); while (srv_running) { - xs *list = user_list(); - char *p, *uid; time_t t; - /* process queues for all users */ - p = list; - while (xs_list_iter(&p, &uid)) { - snac snac; + { + xs *list = user_list(); + char *p, *uid; + + /* process queues for all users */ + p = list; + while (xs_list_iter(&p, &uid)) { + snac snac; - if (user_open(&snac, uid)) { - process_queue(&snac); - user_free(&snac); + if (user_open(&snac, uid)) { + process_queue(&snac); + user_free(&snac); + } } } |