summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/xlator.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-08-31 12:52:34 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-08-31 11:31:23 -0700
commit70652df2f7780aa734119941ac54d88ae6de7ae9 (patch)
tree96928b36d2412c211846e52d73dd2b3fb45b420f /libglusterfs/src/xlator.c
parente7cbae70c89c8813918d9deb3895cb6886cdaeeb (diff)
mgmt/glusterd: memory leak fixes
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1186 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1186
Diffstat (limited to 'libglusterfs/src/xlator.c')
-rw-r--r--libglusterfs/src/xlator.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index fd7db3e032c..2074c143c8c 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -700,6 +700,7 @@ xlator_set_type (xlator_t *xl,
handle = dlopen (name, RTLD_NOW|RTLD_GLOBAL);
if (!handle) {
gf_log ("xlator", GF_LOG_DEBUG, "%s", dlerror ());
+ GF_FREE (name);
return -1;
}
xl->dlhandle = handle;
@@ -707,24 +708,28 @@ xlator_set_type (xlator_t *xl,
if (!(xl->fops = dlsym (handle, "fops"))) {
gf_log ("xlator", GF_LOG_DEBUG, "dlsym(fops) on %s",
dlerror ());
+ GF_FREE (name);
return -1;
}
if (!(xl->cbks = dlsym (handle, "cbks"))) {
gf_log ("xlator", GF_LOG_DEBUG, "dlsym(cbks) on %s",
dlerror ());
+ GF_FREE (name);
return -1;
}
if (!(xl->init = dlsym (handle, "init"))) {
gf_log ("xlator", GF_LOG_DEBUG, "dlsym(init) on %s",
dlerror ());
+ GF_FREE (name);
return -1;
}
if (!(xl->fini = dlsym (handle, "fini"))) {
gf_log ("xlator", GF_LOG_DEBUG, "dlsym(fini) on %s",
dlerror ());
+ GF_FREE (name);
return -1;
}
@@ -749,8 +754,10 @@ xlator_set_type (xlator_t *xl,
vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t),
gf_common_mt_volume_opt_list_t);
- if (!vol_opt)
+ if (!vol_opt) {
+ GF_FREE (name);
return -1;
+ }
if (!(vol_opt->given_opt = dlsym (handle, "options"))) {
dlerror ();