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

Memory leak in zk_client.cc #1659

Closed
wuxiaobai24 opened this issue Apr 19, 2022 · 0 comments · Fixed by #1660
Closed

Memory leak in zk_client.cc #1659

wuxiaobai24 opened this issue Apr 19, 2022 · 0 comments · Fixed by #1660
Assignees
Labels
bug Something isn't working

Comments

@wuxiaobai24
Copy link
Contributor

Bug Description
zoo_get_children will allocate memory in struct String_vector, we need to use deallocate_String_vector to free memory by ourself.

int ret = zoo_get_children(zk_, path.c_str(), 0, &data);

int ret = zoo_get_children(zk_, nodes_root_path_.c_str(), 0, &data);

There are two place to call zoo_get_children, I think we can add deallocate_String_vector(&data) at line 505 and line 530 to fix this bug.

Expected Behavior

Steps to Reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants