revert to allowing NULL in alloc/realloc