diff --git a/XAlloc.c b/XAlloc.c index 385569871427e5d40f30754fcf806e636538466e..34a444f2fbb5d853a43ec3b693feb41b846a61b6 100644 --- a/XAlloc.c +++ b/XAlloc.c @@ -44,8 +44,11 @@ void* xRealloc(void* ptr, size_t size) { } char* xStrdup(const char* str) { + if (!str) { + fail(); + } char* data = strdup(str); - if (!data && str) { + if (!data) { fail(); } return data;