Pointer (Julia) not modified after ccall to C function which uses another C function

The exact code depends on how are the lifetime managed (e.g. whether the struct need to stay alive for a long time). For the general idea, see How to keep a reference for C structure to avoid GC? - #4 by tk3369, including all the context.