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 an unnecessary null pointer check #844

Open
elfring opened this issue Jan 24, 2025 · 3 comments
Open

Remove an unnecessary null pointer check #844

elfring opened this issue Jan 24, 2025 · 3 comments

Comments

@elfring
Copy link

elfring commented Jan 24, 2025

An extra null pointer check is not needed in the function “va_DisplayContextDestroy”.

@elfring
Copy link
Author

elfring commented Jan 24, 2025

Is there another update candidate in the function “gl_create_context”?

libva/va/glx/va_glx_impl.c

Lines 435 to 436 in e4dc66b

if (fbconfigs)
XFree(fbconfigs);

@XinfengZhang
Copy link
Contributor

please pay attention to "goto Error", the fbconfigs maybe is null.
yes, from the link you provided, free(NULL) is harmless. but when the programmer is not sure about the behavior of Xfree.
it should be ok to double check.
the pre-assumption is: I am not sure whether XFree has null pointer check. but we do here will not have side effect. right?

@elfring
Copy link
Author

elfring commented Feb 10, 2025

How do you think about to reduce any remaining uncertainties? 🤔

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

No branches or pull requests

2 participants