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

pppd/options.c: fix memory leak or error path #441

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

chipitsine
Copy link
Contributor

found by Coverity

602err:
603    fclose(f);
604    privileged_option = oldpriv;
   CID 436193 (#1 of 1): Resource leak (RESOURCE_LEAK)10. overwrite_var: Overwriting option_source in option_source = oldsource leaks the storage that option_source points to.
605    option_source = oldsource;

found by Coverity

602err:
603    fclose(f);
604    privileged_option = oldpriv;
   CID 436193 (ppp-project#1 of 1): Resource leak (RESOURCE_LEAK)10. overwrite_var: Overwriting option_source in option_source = oldsource leaks the storage that option_source points to.
605    option_source = oldsource;

Signed-off-by: Ilya Shipitsin <[email protected]>
@Neustradamus
Copy link
Member

@paulusmack: Have you seen this PR?

@paulusmack paulusmack merged commit 26d1b60 into ppp-project:master Sep 1, 2023
25 checks passed
@chipitsine chipitsine deleted the coverity_fix_1 branch September 1, 2023 12:56
chipitsine added a commit to chipitsine/ppp that referenced this pull request Sep 1, 2023
found by Coverity

1803    if (path != arg)
1804        free(path);

    CID 436214 (ppp-project#1 of 1): Resource leak (RESOURCE_LEAK)
    12. leaked_storage: Variable handle going out of scope leaks the
	storage it points to.
	1805    return 1;

Signed-off-by: Ilya Shipitsin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants