From 5aadd0765ba4c21b5ef626f7f8ca8ccff530dd2f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 31 Oct 2011 12:23:21 +0530 Subject: xlator: prevent a crash in xlator_destroy due to uninitialized list was happening when any of the dlopen() fails for xlator loading, and xlator_destroy() was called as it was using a uninitialized list for traversal. now, the list gets initialized at the begining of the xl-init(), so xlator_destroy() works smoothly. Change-Id: I320f6fe922e6d351e6d7c0a3e8da1f6b414d3c47 BUG: 3731 Reviewed-on: http://review.gluster.com/606 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- libglusterfs/src/xlator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 1e349b58c65..023cbc94030 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -193,6 +193,8 @@ xlator_dynload (xlator_t *xl) GF_VALIDATE_OR_GOTO ("xlator", xl, out); + INIT_LIST_HEAD (&xl->volume_options); + ret = gf_asprintf (&name, "%s/%s.so", XLATORDIR, xl->type); if (-1 == ret) { gf_log ("xlator", GF_LOG_ERROR, "asprintf failed"); @@ -256,8 +258,6 @@ xlator_dynload (xlator_t *xl) dlerror()); } - INIT_LIST_HEAD (&xl->volume_options); - vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t), gf_common_mt_volume_opt_list_t); -- cgit