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

free the sshPort to prevent memory leak and indent newly added code to preserve code styling #372

Merged
merged 2 commits into from May 5, 2016

Conversation

StefanAlexandruBogdan
Copy link

Thanks for merging. I made this new pull request to address guanglinlv's comment from pull request #370

@KLuka KLuka merged commit e05c6d8 into shellinabox:master May 5, 2016
@KLuka
Copy link
Member

KLuka commented May 5, 2016

Thanks for another patch. And thank you, @guanglinlv for noticing the leak 👍 I totally missed it :/

memcpy(host, ptr , size-1);
sshPort = strdup (tmp + 1);
memcpy(host, ptr , size - 1);
sshPort = strdup (tmp + 1);

Choose a reason for hiding this comment

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

i think any allocation should be check. you can use the check macro. it is useful for handling the abnormal case.

Copy link
Member

Choose a reason for hiding this comment

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

Done with 628d41f.

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.

None yet

3 participants