diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2010-08-31 12:52:34 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-08-31 11:31:23 -0700 |
commit | 70652df2f7780aa734119941ac54d88ae6de7ae9 (patch) | |
tree | 96928b36d2412c211846e52d73dd2b3fb45b420f /libglusterfs/src/scheduler.c | |
parent | e7cbae70c89c8813918d9deb3895cb6886cdaeeb (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/scheduler.c')
-rw-r--r-- | libglusterfs/src/scheduler.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libglusterfs/src/scheduler.c b/libglusterfs/src/scheduler.c index 94131676e..3fcaef73b 100644 --- a/libglusterfs/src/scheduler.c +++ b/libglusterfs/src/scheduler.c @@ -54,16 +54,18 @@ get_scheduler (xlator_t *xl, const char *name) handle = dlopen (sched_file, RTLD_LAZY); if (!handle) { - gf_log ("scheduler", GF_LOG_ERROR, - "dlopen(%s): %s", sched_file, dlerror ()); - return NULL; + gf_log ("scheduler", GF_LOG_ERROR, + "dlopen(%s): %s", sched_file, dlerror ()); + GF_FREE(sched_file); + return NULL; } tmp_sched = dlsym (handle, "sched"); if (!tmp_sched) { - gf_log ("scheduler", GF_LOG_ERROR, - "dlsym(sched) on %s", dlerror ()); - return NULL; + gf_log ("scheduler", GF_LOG_ERROR, + "dlsym(sched) on %s", dlerror ()); + GF_FREE(sched_file); + return NULL; } vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t), @@ -78,10 +80,12 @@ get_scheduler (xlator_t *xl, const char *name) == -1) { gf_log ("scheduler", GF_LOG_ERROR, "volume option validation failed"); + GF_FREE(sched_file); return NULL; } } GF_FREE(sched_file); + GF_FREE (vol_opt); return tmp_sched; } |