From: Ian Jackson Date: Sun, 9 Jan 2011 04:20:31 +0000 (+0000) Subject: realtime: movpos: avoid a use-after-free X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=0bb9b7e162e5ba2ed14c6354b9f04cec19257436;p=trains.git realtime: movpos: avoid a use-after-free --- diff --git a/hostside/movpos.c b/hostside/movpos.c index e919f47..bfb29a4 100644 --- a/hostside/movpos.c +++ b/hostside/movpos.c @@ -1156,10 +1156,10 @@ void motions_all_abandon(void) { MovPosChange *abandon= seg->motion; indep_remove(abandon); - indep_dispose(abandon); seg->movposcomb= abandon->actual; seg->moving= 0; seg->motion= 0; + indep_dispose(abandon); } for (meth=methods; *meth; meth++) (*meth)->all_abandon(*meth);