Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this code cause a memory leak? #588

Closed
wutiejun opened this issue Mar 17, 2022 · 1 comment
Closed

Does this code cause a memory leak? #588

wutiejun opened this issue Mar 17, 2022 · 1 comment

Comments

@wutiejun
Copy link

s1->s = temp;

s1->s = temp;

If just set the s1->s to temp, the raw memory that referenced by s1->s will lost.

So , I think this may make a memory leak, please confirm it.

@wutiejun
Copy link
Author

Sorry, I don't notice the memory is allocated by realloc function.

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

No branches or pull requests

1 participant