Vladimir Sementsov-Ogievskiy <address@hidden> writes:
[...]
I agree that this is a strange function and its logic is weird. But I
don't know what the logic should be. My patch is still valid to just
fix obvious use-after-free and possible leak. It doesn't fix the
logic.
I sketched improved logic elsewhere in this thread, and I can turn that
into a patch.
I can either make it replace Vladimir's patch, or make it go on top. If
the latter, we can apply just Vladimir's patch for 5.0, and punt mine to
5.1
Got a preference?