From: Jérémie Galarneau Date: Sat, 5 Sep 2015 15:35:43 +0000 (-0400) Subject: Silence use-after-free static analysis warning X-Git-Tag: v2.8.0-rc1~399 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=48b40bcf9da8c227901d15e90f784d7cd5b5935c;p=lttng-tools.git Silence use-after-free static analysis warning clang-analyzer complains that cds_list_for_each_entry_safe() makes use of "wait_node" after free. However, wait_node is only used in __typeof__(). Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index b5cfe307d..d4dae16fd 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -1787,6 +1787,12 @@ static void sanitize_wait_queue(struct ust_reg_wait_queue *wait_queue) wait_queue->count--; ust_app_destroy(wait_node->app); free(wait_node); + /* + * Silence warning of use-after-free in + * cds_list_for_each_entry_safe which uses + * __typeof__(*wait_node). + */ + wait_node = NULL; break; } }