Pass pointer by reference and memory saving

Hi, I am trying to use a pointer that is a vector of char, I was passing the vector by parameter and it seems that this was consuming the memory because I passed it to 3 functions (one calling inside the another) to try to solve the problem I thought of passing a pointer reference to use the same variable in the 3 functions, but I'm having problems populating the vector and the system prints only one character.

The code I'm just using for learning is this:

void setup()
{
  Serial.begin(9600);
}

void loop()
{
    criaVariavel();
    delay(10000);
}

void criaVariavel() {

  	char* vetor;
  	dadosVetor(&vetor);
  	
  	Serial.println(vetor);
	
  	delete[] vetor;
  	free(vetor);
}

void dadosVetor(char** vetor2) {

    *vetor2 = new char[10];
  
    for(int i=0; i<9; i++) {

      *vetor2[i] = 'a';

    }
  
  *vetor2[9] = '\0';
  
}

In println it only shows 'a' instead of 'aaaaaaaaa', this may be because of the way I'm setting the value in the variable within the for?
Is it possible to reference the same pointer to another function from the DataVector()?
Regarding memory usage, is this correct the way I did to release the variable using delete[] and free()?

When you do [nobbc]*vetor2[i][/nobbc] the precedence rules get it interpreted as [nobbc]*(vetor2[i])[/nobbc] and not [nobbc](*vetor2)[i][/nobbc].

Why do you do free(vetor); ?

J-M-L:
When you do [nobbc]*vetor2[i][/nobbc] the precedence rules get it interpreted as [nobbc]*(vetor2[i])[/nobbc] and not [nobbc](*vetor2)[i][/nobbc].

Why do you do free(vetor); ?

I used free() because in my Arduino delete[] did not seem to release the memory, so I decided to test the two on tinkercad.com, I'll test it now on my Arduino because the way you recommended it with pointers worked.

Thank you.

You don't need free...