See comments for an example of what should be fixed. Static variables initalized via calls to malloc can be problematic:
1. Affects restartability or repeated calls to CreateJavaVM / DestroyJavaVM from user JNI code. Specifically, loading libjvm.so will allocate the storage, DestroyJavaVM will presumably deallocate it. But a subsequent call to CreateJavaVM will NOT re-allocate the storage, probably causing access to uninitialized memory.
2. Makes it difficult for tracing malloc usage with mtrace. Mtracing requires an explicit call to mtrace() in user code. It is difficult for user code to get in front of the calls to malloc that are made to initialize static variables. In this case mtrace can miss allocations and erroneously report nonexistent memory leak issues.