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

smb2_opendir memory leak #324

Open
memecode opened this issue Mar 21, 2024 · 3 comments
Open

smb2_opendir memory leak #324

memecode opened this issue Mar 21, 2024 · 3 comments

Comments

@memecode
Copy link
Contributor

memecode commented Mar 21, 2024

So far as I can see... in the implementation of smb2_opendir, if wait_for_reply fails and it falls into the SMB2_STATUS_CANCELLED handler the cb_data memory leaks. It returned NULL instead of free'ing the memory.

In fact the whole 'cb_data->status = SMB2_STATUS_CANCELLED' seems kinda pointless if no one else has that pointer right?

The wait should probably be:

	if (wait_for_reply(smb2, cb_data) < 0) {
                free(cb_data);
                return NULL;
        }

Seems to also be the case for the other sync functions; smb2_stat, smb2_rename etc.

@Wolf3s
Copy link
Contributor

Wolf3s commented Mar 28, 2024

Did you tried to create a pull request here?

@memecode
Copy link
Contributor Author

memecode commented Mar 28, 2024

Did you tried to create a pull request here?

No I've been busy with other things and haven't actually fixed it myself. My focus was on getting a fuse wrapper working with it. Which seems to be fairly successful. Not withstanding some threading issue speed bumps.

@Wolf3s
Copy link
Contributor

Wolf3s commented Mar 28, 2024

Did you tried to create a pull request here?

No I've been busy with other things and haven't actually fixed it myself. My focus was on getting a fuse wrapper working with it. Which seems to be fairly successful. Not withstanding some threading issue speed bumps.

This issue is more related to t_socket integers than something else but your approach seems pretty intersting.

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

2 participants