Use strdup instead of manual malloc + strcpy

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>