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

Remove unnecessary null pointer checks #17385

Open
elfring opened this issue Jan 10, 2025 · 4 comments
Open

Remove unnecessary null pointer checks #17385

elfring opened this issue Jan 10, 2025 · 4 comments
Labels
feature request New enhancement to RetroArch.

Comments

@elfring
Copy link

elfring commented Jan 10, 2025

An extra null pointer check is not needed in functions like the following.

@elfring elfring added the feature request New enhancement to RetroArch. label Jan 10, 2025
@zoltanvb
Copy link
Contributor

co_delete is a false match, I believe.
JSONStringHandler can be corrected eventually, it is indeed not useful
sunxi_init: even though technically it is not needed, I would leave it there in case there is some change to the code above.

@LibretroAdmin
Copy link
Contributor

e30fcb6

I pushed through the change for JSONStringHandler.

@elfring
Copy link
Author

elfring commented Jan 13, 2025

Thanks for a source code improvement.

@elfring
Copy link
Author

elfring commented Jan 13, 2025

💭 I am curious if another software developer (besides me) can get into the mood to apply a corresponding update suggestion which could be generated by the software “Coccinelle” (also with the help of a variant from the following script).

@Remove_unnecessary_pointer_checks@
expression x;
@@
-if (\(x != 0 \| x != NULL\))
    free(x);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New enhancement to RetroArch.
Projects
None yet
Development

No branches or pull requests

3 participants