Say, if I have this piece of code

```
void alloc_mem(int size, double **x) 
{

   *x = malloc(size*sizeof(double));

   for ( int i = 0; i < size; i++ ) ( *x )[i] = i;
}

void test_function()
{
    double *x;
    alloc_mem(10, &x);
    free(x);
}

```

I am allocating the memory on heap in one function, and deleting it inside another. Is it okay in