Use strdup(9) instead of reimplementing it.