libfreerdp-utils: re-introduce free(NULL) check in xfree()

This commit is contained in:
Marc-André Moreau 2012-02-09 20:32:08 -05:00
parent 717b37fd48
commit 8e88983a62

View File

@ -40,7 +40,7 @@ void* xmalloc(size_t size)
if (mem == NULL) if (mem == NULL)
{ {
perror("xmalloc"); perror("xmalloc");
printf("xmalloc: failed to allocate memory of size: %d\n", size); printf("xmalloc: failed to allocate memory of size: %d\n", (int) size);
} }
return mem; return mem;
@ -63,7 +63,7 @@ void* xzalloc(size_t size)
if (mem == NULL) if (mem == NULL)
{ {
perror("xzalloc"); perror("xzalloc");
printf("xzalloc: failed to allocate memory of size: %d\n", size); printf("xzalloc: failed to allocate memory of size: %d\n", (int) size);
} }
return mem; return mem;
@ -103,6 +103,7 @@ void* xrealloc(void* ptr, size_t size)
void xfree(void* ptr) void xfree(void* ptr)
{ {
if (ptr != NULL)
free(ptr); free(ptr);
} }