if (!x) return;
you know that x is non-zero etc. Or after x = malloc()
you can know that x is - at this point - a pointer that has
exclusive ownership (if x is non-null).So I think it is a viable approach. I have a toy C front end that does something similar. While this project stalled due to lack of time, I think it is doable with a modest amount of annotations and not more pain than Rust.