Fix: use-after-free in statedump lib iter_end
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 6 Jul 2016 19:16:30 +0000 (15:16 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 6 Jul 2016 19:17:00 +0000 (15:17 -0400)
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 <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-statedump.c

index c8e508cdf9e9bd477f333ce79046e42625d64922..2fb8f34d9b4f4e34d803813498187273441fc487 100644 (file)
@@ -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();
This page took 0.037795 seconds and 4 git commands to generate.