]> git.neil.brown.name Git - wiggle.git/commit
vpatch: call sort_patches() before main_window().
authorNeilBrown <neilb@suse.de>
Fri, 27 Dec 2019 04:31:48 +0000 (15:31 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 27 Dec 2019 04:31:48 +0000 (15:31 +1100)
commit9113e6f179b4e9c55f46a0b8fc824bb20ee2e2f1
treeec3e1681b20ac47b8216da26b8e6b6e28510e215
parentd55ce20c7fa5301011396b6302c584b3680b2583
vpatch: call sort_patches() before main_window().

sort_patches() can reallocate the patch list array.
So after main_window is called (which calls sort_patches())
the patchs array might have changed.  We current call
plist_free() on the old patch list, which can crash.

So instead, call sort_patches() before calling main_window(),
then call plist_free() afterwards, on the patch list
that sort_patches() returned.
This avoids the crash.

Signed-off-by: NeilBrown <neil@brown.name>
vpatch.c