summaryrefslogtreecommitdiffstats
path: root/server/scoreboard.c
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2017-07-21 19:22:05 +0200
committerYann Ylavic <ylavic@apache.org>2017-07-21 19:22:05 +0200
commit21160f88645298756f317dc13312c860ee0bd76d (patch)
tree1da7f1c80bd73fd4eb7c4c8d17152fe2ef2eac34 /server/scoreboard.c
parentmpm_event: ap_queue_info_try_get_idler() may atomically decrement and then (diff)
downloadapache2-21160f88645298756f317dc13312c860ee0bd76d.tar.xz
apache2-21160f88645298756f317dc13312c860ee0bd76d.zip
core, mpm_event: Add ap_update_sb_handle() to avoid a small memory leak of
sizeof(ap_sb_handle_t) when re-entering event's process_socket(). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1802618 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/scoreboard.c')
-rw-r--r--server/scoreboard.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/scoreboard.c b/server/scoreboard.c
index a30c7a4529..4eb1b05890 100644
--- a/server/scoreboard.c
+++ b/server/scoreboard.c
@@ -422,12 +422,18 @@ AP_DECLARE(int) ap_find_child_by_pid(apr_proc_t *pid)
return -1;
}
+AP_DECLARE(void) ap_update_sb_handle(ap_sb_handle_t *sbh,
+ int child_num, int thread_num)
+{
+ sbh->child_num = child_num;
+ sbh->thread_num = thread_num;
+}
+
AP_DECLARE(void) ap_create_sb_handle(ap_sb_handle_t **new_sbh, apr_pool_t *p,
int child_num, int thread_num)
{
*new_sbh = (ap_sb_handle_t *)apr_palloc(p, sizeof(ap_sb_handle_t));
- (*new_sbh)->child_num = child_num;
- (*new_sbh)->thread_num = thread_num;
+ ap_update_sb_handle(*new_sbh, child_num, thread_num);
}
static void copy_request(char *rbuf, apr_size_t rbuflen, request_rec *r)