From: David Goulet Date: Mon, 19 Mar 2012 21:16:28 +0000 (-0400) Subject: Fix: hash table allocation out of order on error X-Git-Tag: v2.0.0-rc4~18 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1427f9b224ad5d47a91a29db8e6687aa6d76534a;p=lttng-tools.git Fix: hash table allocation out of order on error Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 8d0a841ed..8b09fc922 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -4516,6 +4516,12 @@ int main(int argc, char **argv) goto error; } + /* + * Init UST app hash table. Alloc hash table before this point since + * cleanup() can get called after that point. + */ + ust_app_ht_alloc(); + /* After this point, we can safely call cleanup() with "goto exit" */ /* @@ -4581,9 +4587,6 @@ int main(int argc, char **argv) /* Init UST command queue. */ cds_wfq_init(&ust_cmd_queue.queue); - /* Init UST app hash table */ - ust_app_ht_alloc(); - /* * Get session list pointer. This pointer MUST NOT be free(). This list is * statically declared in session.c