summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2013-03-18 19:14:24 +0530
committerAnand Avati <avati@redhat.com>2013-03-20 19:57:16 -0700
commitf6d32dd6e8d0e4f52508162783b18828c0c363fa (patch)
treeb89b11f6365857c56f9ae0eb4bdd682061a68406 /libglusterfs/src
parent78bf67f6d1caff4b56060a5029b0620f57634fc5 (diff)
rpc: before freeing the volume options object, delete it from the list
* Suppose there is an xlator option which is considered by the xlator only if the source was built with debug mode enabled (the only example in the current code base is run-with-valgrind option for glusterd), then giving that option would make the process crash if the source was not built with debug mode enabled. Reason: In rpc, after getting the options symbol dynamically, it was stored in the newly allocated volume options structure and the structure's list head was added to the xlator's volume_options list. But while freeing the structure the list was not deleted. Thus when the list was traversed, already freed structure was accessed leading to segfault. Change-Id: I3e9e51dd2099e34b206199eae7ba44d9d88a86ad BUG: 922877 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/4687 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/xlator.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index 22c81f81b88..3fb6eeebb09 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -264,6 +264,7 @@ xlator_dynload (xlator_t *xl)
gf_log (xl->name, GF_LOG_TRACE,
"Strict option validation not enforced -- neglecting");
}
+ INIT_LIST_HEAD (&vol_opt->list);
list_add_tail (&vol_opt->list, &xl->volume_options);
fill_defaults (xl);