remove redundant if(NULL) checks (already checked inside of cache_free and rail_free)
Besides "ptr=NULL; free(ptr);" does nothing so no need to check for NULL in xfree()
This commit is contained in:
parent
9c81ff8022
commit
5ca9a37f68
@ -888,16 +888,11 @@ void xf_window_free(xfInfo* xfi)
|
||||
|
||||
if (context != NULL)
|
||||
{
|
||||
if (context->cache != NULL)
|
||||
{
|
||||
cache_free(context->cache);
|
||||
context->cache = NULL;
|
||||
}
|
||||
if (context->rail != NULL)
|
||||
{
|
||||
|
||||
rail_free(context->rail);
|
||||
context->rail = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (xfi->rfx_context)
|
||||
@ -917,8 +912,7 @@ void xf_free(xfInfo* xfi)
|
||||
{
|
||||
xf_window_free(xfi);
|
||||
|
||||
if (xfi->bmp_codec_none != NULL)
|
||||
xfree(xfi->bmp_codec_none);
|
||||
xfree(xfi->bmp_codec_none);
|
||||
|
||||
XCloseDisplay(xfi->display);
|
||||
|
||||
|
@ -103,7 +103,6 @@ void* xrealloc(void* ptr, size_t size)
|
||||
|
||||
void xfree(void* ptr)
|
||||
{
|
||||
if (ptr != NULL)
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user