From 029430690fdbb1307597237754a56cd733b6d618 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sun, 11 Oct 2026 16:01:12 +0200 Subject: [PATCH] test(json2): destroy the value before constructing over it ValueClear constructs a Value, then calls the Value(const Object&) constructor on the same object. The constructor allocates a new node and overwrites the pointer, so the first node (56 bytes) is never freed. LeakSanitizer reports it; destroy the value first. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb --- core/libs/tests/GuestJson.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/libs/tests/GuestJson.cpp b/core/libs/tests/GuestJson.cpp index 8150bc249..147ac9094 100644 --- a/core/libs/tests/GuestJson.cpp +++ b/core/libs/tests/GuestJson.cpp @@ -384,6 +384,7 @@ static void ValueClear() { _ZN3sce4Json6StringC1EPKc(&key, "prop"); Value* item = _ZN3sce4Json6ObjectixERKNS0_6StringE(&obj, &key); _ZN3sce4Json5Value3setEl(item, 999); + _ZN3sce4Json5ValueD1Ev(&value); _ZN3sce4Json5ValueC1ERKNS0_6ObjectE(&value, &obj); Require(_ZNK3sce4Json5Value7getTypeEv(&value) == TypeObject); _ZN3sce4Json5Value5clearEv(&value);