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

Fix some memory or file descriptor leaks in test code. #681

Merged
merged 1 commit into from
Jan 14, 2018

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Jan 14, 2018

This change is Reviewable

@sudden6
Copy link

sudden6 commented Jan 14, 2018

Reviewed 5 of 7 files at r1.
Review status: 5 of 7 files reviewed at latest revision, 3 unresolved discussions.


auto_tests/onion_test.c, line 306 at r1 (raw file):

    if (!on->onion) {
        free(on);
        return NULL;

leaks dht and maybe neworking


auto_tests/onion_test.c, line 314 at r1 (raw file):

        kill_onion(on->onion);
        free(on);
        return NULL;

same


auto_tests/onion_test.c, line 324 at r1 (raw file):

        kill_onion(on->onion);
        free(on);
        return NULL;

same


Comments from Reviewable

@iphydf iphydf modified the milestones: v0.2.0-RC1, v0.2.0 Jan 14, 2018
@iphydf iphydf force-pushed the socket-leak branch 2 times, most recently from 15fe382 to 61a9a09 Compare January 14, 2018 15:34
@iphydf
Copy link
Member Author

iphydf commented Jan 14, 2018

Review status: 5 of 7 files reviewed at latest revision, 3 unresolved discussions.


auto_tests/onion_test.c, line 306 at r1 (raw file):

Previously, sudden6 wrote…

leaks dht and maybe neworking

Yes, and yes. Fixed both.


auto_tests/onion_test.c, line 314 at r1 (raw file):

Previously, sudden6 wrote…

same

Done.


auto_tests/onion_test.c, line 324 at r1 (raw file):

Previously, sudden6 wrote…

same

Done.


Comments from Reviewable

@iphydf iphydf modified the milestones: v0.2.0-RC1, v0.2.0 Jan 14, 2018
@Diadlo
Copy link

Diadlo commented Jan 14, 2018

I'm not sure, but what about goto fail; in every if? And place last if body after return on;

@jhert0
Copy link
Member

jhert0 commented Jan 14, 2018

:lgtm_strong:


Reviewed 6 of 7 files at r1, 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.


Comments from Reviewable

@sudden6
Copy link

sudden6 commented Jan 14, 2018

:lgtm_strong: and I also agree with @Diadlo, we should at least consider introducing this style.


Reviewed 1 of 7 files at r1, 1 of 1 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

Also some missing return value checks for `fopen`.
@iphydf iphydf merged commit 1eea3f0 into TokTok:master Jan 14, 2018
@iphydf iphydf deleted the socket-leak branch January 14, 2018 19:15
This pull request was closed.
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.

4 participants