passing malloc results down the stack