summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port_memory.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-08-02 13:22:03 +0300
committerMax Romanov <max.romanov@nginx.com>2017-08-02 13:22:03 +0300
commit021a84019f48c9027254f15c9b9db7ea12535dd0 (patch)
treefa5905bf43f4a96d142bea81b1b6f2d6c7b1c2e9 /src/nxt_port_memory.c
parent9367dd2bf8982d7dbe5e8c71643d3e5d5ee494e1 (diff)
downloadunit-021a84019f48c9027254f15c9b9db7ea12535dd0.tar.gz
unit-021a84019f48c9027254f15c9b9db7ea12535dd0.tar.bz2
Freed mmap memory filled with 0xA5.
Diffstat (limited to 'src/nxt_port_memory.c')
-rw-r--r--src/nxt_port_memory.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nxt_port_memory.c b/src/nxt_port_memory.c
index 454827f0..d21d263a 100644
--- a/src/nxt_port_memory.c
+++ b/src/nxt_port_memory.c
@@ -76,6 +76,10 @@ nxt_port_mmaps_destroy(nxt_array_t *port_mmaps, nxt_bool_t destroy_pool)
}
+#define nxt_port_mmap_free_junk(p, size) \
+ memset((p), 0xA5, size)
+
+
static void
nxt_port_mmap_buf_completion(nxt_task_t *task, void *obj, void *data)
{
@@ -119,6 +123,8 @@ nxt_port_mmap_buf_completion(nxt_task_t *task, void *obj, void *data)
c = nxt_port_mmap_chunk_id(hdr, p);
}
+ nxt_port_mmap_free_junk(p, b->mem.end - p);
+
while (p < b->mem.end) {
nxt_port_mmap_set_chunk_free(hdr, c);