From e288f690afdef701f76b7f85e25ca6bdf647716f Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Thu, 2 Jun 2016 18:30:18 +0800 Subject: [PATCH] Don't check if (!str) in xStrdup This effectively reverts "Stricter strdup." 4674b4a7320bb6b003a4e3b3840027573691e60d If str is NULL upon the calling of strdup(), it should crash with SIGSEGV. Just let it crash. Adding the "if (!str) fail();" code serves nothing but bloat. --- XAlloc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/XAlloc.c b/XAlloc.c index 34a444f..010d761 100644 --- a/XAlloc.c +++ b/XAlloc.c @@ -44,9 +44,6 @@ void* xRealloc(void* ptr, size_t size) { } char* xStrdup(const char* str) { - if (!str) { - fail(); - } char* data = strdup(str); if (!data) { fail(); -- GitLab