Hi,
In general, LabVIEW handles memory management for you. When you need to call external code, you should avoid memory manipulation outside of LabVIEW. If you pass a buffer created by LabVIEW to your C code, you'll be fine using it as long as you don't reallocate or deallocate the memory that LabVIEW gave you.
You should keep memory management separate. If your C code requieres memory allocation, its better if you allocate and deallocate it from the C side. But don't mix them up, don't return to LabVIEW a buffer allocated withing your C code.
If you just need a scratch pad internal to your C code, allocate your own memory and release it when you are done inside your C code. Return to LabVIEW just the values that are pertinent.
Another impo
rtant thing. When calling a DLL through the Call Library Node, make sure you configure the node to be reentrant. Under RT, failure to do so causes your C code to be executed under the user interface thread. This will affect the RT scheduler, decrease performance and introduce jitter.
Hope this helps,
Daniel