Skip to content

[v2.16]core: fix empty array write memory leak - #2960

Merged
fengzeroz merged 1 commit into
emqx:v2.16from
ZhouBox:v2.16
Nov 13, 2026
Merged

fengzeroz merged 1 commit into
emqx:v2.16from
ZhouBox:v2.16

Conversation

@ZhouBox

@ZhouBox ZhouBox commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T11:04:18.519078Z 68e9946 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov-commenter

codecov-commenter commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.06897% with 73 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.00%. Comparing base (64119b3) to head (68e9946).

Files with missing lines Patch % Lines
src/adapter/driver/driver.c 33.33% 38 Missing ⚠️
plugins/restful/rw_handle.c 20.68% 23 Missing ⚠️
src/adapter/adapter.c 0.00% 4 Missing ⚠️
src/core/manager.c 33.33% 4 Missing ⚠️
include/neuron/msg.h 83.33% 3 Missing ⚠️
src/parser/neu_json_rw.c 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            v2.16    #2960      +/-   ##
==========================================
- Coverage   69.05%   69.00%   -0.05%     
==========================================
  Files         137      137              
  Lines       34799    34860      +61     
==========================================
+ Hits        24030    24055      +25     
- Misses      10769    10805      +36     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68e9946976

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/parser/neu_json_rw.c
req->groups[i].tags[k].t = v_elems[1].t;
req->groups[i].tags[k].value = v_elems[1].v;
if (req->groups[i].tags[k].t == NEU_JSON_OBJECT) {
json_incref(req->groups[i].tags[k].value.val_object);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Release retained custom values when gtags decoding aborts

When a write_gtags payload contains a valid object-valued tag followed by a malformed group or tag, this increments the first object's reference count, but the subsequent failure paths in decode_write_gtags_req_json only free the tag arrays. neu_json_decode_write_gtags_req then releases the root JSON object, leaving this extra reference unreachable, so repeated invalid requests leak each object encountered before the error; decrement retained object values during partial-decode cleanup.

Useful? React with 👍 / 👎.

@ZhouBox
ZhouBox requested a review from fengzeroz November 12, 2026 11:30
@fengzeroz
fengzeroz merged commit ec4b1ec into emqx:v2.16 Nov 13, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants