Skip to content

Conversation

@zengwei00
Copy link

fix the Memory leak: nbuf

Signed-off-by: zengwei [email protected]

fix the Memory leak: nbuf
a12int_trace(A12_TRACE_SYSTEM, "kind=error:status=ENOMEM");
DYNAMIC_FREE(*next);
*next = NULL;
DYNAMIC_FREE(*nbuf);
Copy link

@CorruptedVor CorruptedVor Aug 7, 2024

Choose a reason for hiding this comment

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

I think it's more likely that the check was supposed to be if (!nbuf) on line 1553, and assuming correct usage of calling it with a non-NULL buf.

Copy link

@CorruptedVor CorruptedVor Aug 7, 2024

Choose a reason for hiding this comment

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

This is still incomplete, there is never a check for whether nbuf was allocated sucessfully.

In fact, when nbuf allocation fails, this dereferences nbuf anyway (*nbuf), which hopefully causes SIGSEGV

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.

2 participants