Instead of storing index, just store pointer to the path data, that is:
const char* pathData = NULL;