From: Mathieu Desnoyers Date: Wed, 6 Jul 2016 19:16:30 +0000 (-0400) Subject: Fix: use-after-free in statedump lib iter_end X-Git-Tag: v2.9.0-rc1~41 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b891574ec1aaaddf943361927da7a31ebb9db03d;p=lttng-ust.git Fix: use-after-free in statedump lib iter_end Found by Coverity: ** CID 1357361: Memory - corruptions (USE_AFTER_FREE) /liblttng-ust/lttng-ust-statedump.c: 440 in iter_end() Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/lttng-ust-statedump.c b/liblttng-ust/lttng-ust-statedump.c index c8e508cd..2fb8f34d 100644 --- a/liblttng-ust/lttng-ust-statedump.c +++ b/liblttng-ust/lttng-ust-statedump.c @@ -431,13 +431,13 @@ void iter_end(struct dl_iterate_data *data, void *ip) trace_lib_load(&e->bin_data, ip); e->traced = true; } + e->marked = false; } else { if (e->traced) trace_lib_unload(&e->bin_data, ip); remove_dl_node(e); free_dl_node(e); } - e->marked = false; } } ust_unlock();