<p>I think I've got it down to the most basic case:</p>

<pre><code>int main(int argc, char ** argv) {
  int * arr;

  foo(arr);
  printf("car[3]=%d\n",arr[3]);
  free (arr);
  return 1;
}

void foo(int * arr) {
  arr = (int*) malloc( sizeof(int)*25 );
  arr[3] = 69;
}
</code></pre>

<p>The output is this:</p>

<pre class="lang-none prettyprint-override"><code>&gt; ./a.out 
 car[3]=-1869558540
 a.out(4100) malloc: *** error for object 0x8fe01037: Non-aligned pointer
                         being freed
 *** set a breakpoint in malloc_error_break to debug
&gt;
</code></pre>

<p>If anyone can shed light on where my understanding is failing, it'd be greatly appreciated.</p>

You've allocated arr in foo, but that pointers value is stored in the call stack. If you want to do this, do it like this:
```
```
void foo( int ** arr) {
    *arr = (int *)malloc( sizeof(int) * 25 );
    (*arr)[3] = 69;
}
```
```
And in main, simply pass a pointer to foo (like foo(&arr))