another NULL check, this time if strdup doesn't work