You are never going to get any guaranteed sensible behaviour for a double free or an use after free [1]. In comparison to those giant issues, all other instances of UB are minor.
[1] well, you can today by swapping malloc for a GC-enabled implementation, but the fact is that almost nobody does.
> well, you can today by swapping malloc for a GC-enabled implementation
You don't need GC for this (at least, in the sense of "we'll call free for you"), you just need to verify that things passed to free were handed out via malloc.
[1] well, you can today by swapping malloc for a GC-enabled implementation, but the fact is that almost nobody does.