I realise that this is a cut down piece of code, but if you're doing this here, you're almost certainly doing it in your main code.
The issue is that you should pretty much
never dynamically create a vector. Think of a vector as a pointer to an array. Why would you dynamically allocate that pointer itself?! (okay it's actually typically 3 pointers but no diff)
The array inside the vector is already dynamically allocated. Then to pass them to another function, you do so by reference (const if that function doesn't modify them)
Here's a corrected and simplified version of your sample program:
I could tell you why your original version didn't work, but that would probably lead you furthur away from how it should be implemented.