Fixed invalid xstrdup to NULL pointer.