replace malloc(strlen())/strlcpy with strdup

 It is strange to use the size of the source buffer to copy to dest,
 even if it is correct based on the malloc call above.