Skip to content

Conversation

thien-codev
Copy link

  • When realloc fails, it returns NULL, and the original memory block remains allocated. In the current implementation, if realloc fails, the original memory block is overwritten (i.e., the buf->ptr gets NULL), causing the reference to the original memory to be lost, leading to a memory leak.

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.

1 participant