Skip to content
← All reviews
antirez/ds4 #571 · solodddd · 4mo ago

server: restore schema-declared argument types for GLM tool calls

Panel verdict

The panel surfaced minor issues worth a look before merge.

2
raised by reviewers
2
kept by the panel

Findings

MediumArchitectureconfidence 0.85

json_schema_value_type leaks memory on early return

When the function encounters a key other than "type" and then fails to skip the value (json_skip_value returns false), it returns NULL without freeing the key that was just allocated by json_string. This leaks the key string.

LowArchitectureconfidence 0.90

json_schema_value_type leaks memory on malformed input

If json_string succeeds for the key but the following character is not ':' (the if (*p != ':') branch), the function returns NULL after freeing key. However, if json_string fails (returns false), the function returns NULL without freeing key because key may have been partially allocated or left as NULL. The json_string implementation is not shown, but if it allocates key before failing, this is a leak. Even if it doesn't, the pattern is fragile.

3 reviewers · deepseek/deepseek-v4-pro · reviewed in 1m 51s · 1 file, +174 −18

Ship the PR.
Skip the noise.

Free on 2 repositories · No credit card · Advisory only—never blocks a merge