check if strdup returned NULL