If I remove the strdup() I get a compile error:
cannot convert from 'const char *' to 'char *'     :(