Edited to free allocation by strdup for main user case