Finding all unsafe code in a large C wrapper

I have a large julia wrapper of C code. It contains some undefined behavior. For instance, it might allocate a Vector, put a pointer to the vector in some struct, pass that struct to a C-API without any GC.@preserve on the original vector.
Are there tools that can help find such unsafe code areas?