X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=liblttkconsumerd%2Fliblttkconsumerd.c;h=a135570fd5c2fe1efebd3c69d443e75e25e949ba;hp=f60888a83fc8f5ebc5758155770876973216c01e;hb=fbf10601d3fca6076d257916e9bc38c81b3063e1;hpb=31f73cc98df1a3f69c1bc175a7b0eafa99cfb282 diff --git a/liblttkconsumerd/liblttkconsumerd.c b/liblttkconsumerd/liblttkconsumerd.c index f60888a83..a135570fd 100644 --- a/liblttkconsumerd/liblttkconsumerd.c +++ b/liblttkconsumerd/liblttkconsumerd.c @@ -1004,7 +1004,7 @@ end: */ void kconsumerd_cleanup(void) { - struct kconsumerd_fd *iter; + struct kconsumerd_fd *iter, *tmp; /* remove the socket file */ unlink(kconsumerd_command_sock_path); @@ -1014,7 +1014,7 @@ void kconsumerd_cleanup(void) * running (after joining on the threads), no need to protect * list iteration with mutex. */ - cds_list_for_each_entry(iter, &kconsumerd_data.fd_list.head, list) { + cds_list_for_each_entry_safe(iter, tmp, &kconsumerd_data.fd_list.head, list) { kconsumerd_del_fd(iter); } }