X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fdispatch.c;h=d172f1a36b6c047691a51ceefc27835fb1876ec8;hb=a4eb26f0f09cd6d031166329a7d5d7b5d40408a6;hp=a637f23dea8e8e665b3a87b88644cc18a7337bb8;hpb=ea6bf30f3684cf71633cb9f2c70ea0bc22b664c4;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/dispatch.c b/src/bin/lttng-sessiond/dispatch.c index a637f23de..d172f1a36 100644 --- a/src/bin/lttng-sessiond/dispatch.c +++ b/src/bin/lttng-sessiond/dispatch.c @@ -1,20 +1,10 @@ /* - * Copyright (C) 2011 - David Goulet - * Mathieu Desnoyers - * 2013 - Jérémie Galarneau + * Copyright (C) 2011 EfficiOS Inc. + * Copyright (C) 2011 Mathieu Desnoyers + * Copyright (C) 2013 Jérémie Galarneau * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2 only, - * as published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -61,7 +51,8 @@ static void update_ust_app(int app_sock) continue; } session_lock(sess); - if (!sess->active || !sess->ust_session) { + if (!sess->active || !sess->ust_session || + !sess->ust_session->active) { goto unlock_session; } @@ -304,6 +295,7 @@ static void *thread_dispatch_ust_registration(void *data) } lttng_fd_put(LTTNG_FD_APPS, 1); free(ust_cmd); + ust_cmd = NULL; goto error; } CDS_INIT_LIST_HEAD(&wait_node->head); @@ -318,7 +310,9 @@ static void *thread_dispatch_ust_registration(void *data) } lttng_fd_put(LTTNG_FD_APPS, 1); free(wait_node); + wait_node = NULL; free(ust_cmd); + ust_cmd = NULL; continue; } /* @@ -329,6 +323,7 @@ static void *thread_dispatch_ust_registration(void *data) wait_queue.count++; free(ust_cmd); + ust_cmd = NULL; /* * We have to continue here since we don't have the notify * socket and the application MUST be added to the hash table @@ -349,6 +344,7 @@ static void *thread_dispatch_ust_registration(void *data) wait_queue.count--; app = wait_node->app; free(wait_node); + wait_node = NULL; DBG3("UST app notify socket %d is set", ust_cmd->sock); break; } @@ -367,6 +363,7 @@ static void *thread_dispatch_ust_registration(void *data) lttng_fd_put(LTTNG_FD_APPS, 1); } free(ust_cmd); + ust_cmd = NULL; } if (app) {