Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.

Commit 6592467

Browse files
author
Stefan Eissing
committed
* Fix for a memory leak in handling of JSON arrays. This leak was mainly
triggered by the additions to the `server-status` handler and lead to increased process sizes with each request of a status page.
1 parent e05c36d commit 6592467

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Fix for a memory leak in handling of JSON arrays. This leak was mainly
2+
triggered by the additions to the `server-status` handler and lead to
3+
increased process sizes with each request of a status page.
4+
15
v2.4.13
26
----------------------------------------------------------------------------------------------------
37
* A possible NULL pointer deref was fixed in the JSON code for

src/md_json.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static apr_status_t jselect_add(json_t *val, md_json_t *json, va_list ap)
176176
aj = json_object_get(j, key);
177177
if (!aj) {
178178
aj = json_array();
179-
json_object_set(j, key, aj);
179+
json_object_set_new(j, key, aj);
180180
}
181181

182182
if (!json_is_array(aj)) {
@@ -202,7 +202,7 @@ static apr_status_t jselect_insert(json_t *val, size_t index, md_json_t *json, v
202202
aj = json_object_get(j, key);
203203
if (!aj) {
204204
aj = json_array();
205-
json_object_set(j, key, aj);
205+
json_object_set_new(j, key, aj);
206206
}
207207

208208
if (!json_is_array(aj)) {

0 commit comments

Comments
 (0)