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:
Alexis Moinet 2012-02-03 15:27:04 +01:00
parent 9c81ff8022
commit 5ca9a37f68
2 changed files with 2 additions and 9 deletions

View File

@ -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);

View File

@ -103,7 +103,6 @@ void* xrealloc(void* ptr, size_t size)
void xfree(void* ptr)
{
if (ptr != NULL)
free(ptr);
}