From: Zqiang <qiang.zh...@windriver.com>

If create timer thread failed, the 'ctx->timer' need
to be released.

Signed-off-by: Zqiang <qiang.zh...@windriver.com>
---
 libglusterfs/src/timer.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c
index 66c861b04c..2684d39667 100644
--- a/libglusterfs/src/timer.c
+++ b/libglusterfs/src/timer.c
@@ -213,6 +213,12 @@ gf_timer_registry_init(glusterfs_ctx_t *ctx)
     if (ret) {
         gf_msg(THIS->name, GF_LOG_ERROR, ret, LG_MSG_PTHREAD_FAILED,
                "Thread creation failed");
+       LOCK(&ctx->lock);
+       reg = ctx->timer;
+       ctx->timer = NULL;
+       UNLOCK(&ctx->lock);
+       GF_FREE(reg);
+       reg = NULL;
     }
 
 out:
-- 
2.25.1

-------

Community Meeting Calendar:
Schedule -
Every 2nd and 4th Tuesday at 14:30 IST / 09:00 UTC
Bridge: https://meet.google.com/cpu-eiue-hvk

Gluster-devel mailing list
Gluster-devel@gluster.org
https://lists.gluster.org/mailman/listinfo/gluster-devel

Reply via email to