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 on error path (#441) #444

Closed
wants to merge 1 commit into from

Conversation

chipitsine
Copy link
Contributor

found by Coverity

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

CID 436214 (#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;

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]>
@paulusmack
Copy link
Collaborator

The man page for dlclose() says "If the object's reference count drops to zero and no symbols in this object are required by other objects, then the object is unloaded...". In general a plugin won't have symbols that are required by other objects, so it would get immediately unloaded. And despite the commit headline, the line you are adding is in the success path, not the error path, so unloading the plugin would be entirely the wrong thing to do.

So this patch is quite wrong. I don't see anything needing to be fixed in the existing pppd code.

@paulusmack paulusmack closed this Sep 2, 2023
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.

2 participants