summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/scheduler.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-04-22 13:33:09 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-23 06:32:52 -0700
commit582de0677da4be19fc6f873625c58c45d069ab1c (patch)
treef10cb3e26e1f92f6ea91034e6f7bb925790dd9bc /libglusterfs/src/scheduler.c
parent72baa17282f5cf749fa743fd601c7b728ece4fa2 (diff)
Memory accounting changes
Memory accounting Changes. Thanks to Vinayak Hegde and Csaba Henk for their contributions. Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 329 (Replacing memory allocation functions with mem-type functions) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=329
Diffstat (limited to 'libglusterfs/src/scheduler.c')
-rw-r--r--libglusterfs/src/scheduler.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libglusterfs/src/scheduler.c b/libglusterfs/src/scheduler.c
index 459c7d86872..94131676e17 100644
--- a/libglusterfs/src/scheduler.c
+++ b/libglusterfs/src/scheduler.c
@@ -43,7 +43,7 @@ get_scheduler (xlator_t *xl, const char *name)
return NULL;
}
- ret = asprintf (&sched_file, "%s/%s.so", SCHEDULERDIR, name);
+ ret = gf_asprintf (&sched_file, "%s/%s.so", SCHEDULERDIR, name);
if (-1 == ret) {
gf_log ("scheduler", GF_LOG_ERROR, "asprintf failed");
return NULL;
@@ -66,7 +66,8 @@ get_scheduler (xlator_t *xl, const char *name)
return NULL;
}
- vol_opt = CALLOC (1, sizeof (volume_opt_list_t));
+ vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t),
+ gf_common_mt_volume_opt_list_t);
vol_opt->given_opt = dlsym (handle, "options");
if (vol_opt->given_opt == NULL) {
gf_log ("scheduler", GF_LOG_DEBUG,
@@ -80,6 +81,7 @@ get_scheduler (xlator_t *xl, const char *name)
return NULL;
}
}
+ GF_FREE(sched_file);
return tmp_sched;
}