X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fthread.c;h=ff6c0962f33768390500e7e5da2cedee55311a5f;hp=6eb5e8efb3124f67b7f1315c788162eaa67f31dd;hb=2d97a0067600335f07eecb2c1d9ba68fc164583e;hpb=21fa020ee12d44632c5efde063869d542897bdd1 diff --git a/src/bin/lttng-sessiond/thread.c b/src/bin/lttng-sessiond/thread.c index 6eb5e8efb..ff6c0962f 100644 --- a/src/bin/lttng-sessiond/thread.c +++ b/src/bin/lttng-sessiond/thread.c @@ -140,6 +140,9 @@ bool lttng_thread_get(struct lttng_thread *thread) void lttng_thread_put(struct lttng_thread *thread) { + if (!thread) { + return; + } assert(thread->ref.refcount); urcu_ref_put(&thread->ref, lttng_thread_release); } @@ -169,6 +172,7 @@ bool _lttng_thread_shutdown(struct lttng_thread *thread) if (ret) { PERROR("Failed to join \"%s\" thread", thread->name); result = false; + goto end; } /* Release the list's reference to the thread. */ cds_list_del(&thread->node);