summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/authenticate.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/authenticate.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/authenticate.c')
-rw-r--r--libglusterfs/src/authenticate.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libglusterfs/src/authenticate.c b/libglusterfs/src/authenticate.c
index 6a6fd03ac79..eb0e2464cf6 100644
--- a/libglusterfs/src/authenticate.c
+++ b/libglusterfs/src/authenticate.c
@@ -58,7 +58,7 @@ init (dict_t *this,
key = "addr";
}
- ret = asprintf (&auth_file, "%s/%s.so", LIBDIR, key);
+ ret = gf_asprintf (&auth_file, "%s/%s.so", LIBDIR, key);
if (-1 == ret) {
gf_log ("authenticate", GF_LOG_ERROR, "asprintf failed");
dict_set (this, key, data_from_dynptr (NULL, 0));
@@ -71,11 +71,11 @@ init (dict_t *this,
gf_log ("authenticate", GF_LOG_ERROR, "dlopen(%s): %s\n",
auth_file, dlerror ());
dict_set (this, key, data_from_dynptr (NULL, 0));
- FREE (auth_file);
+ GF_FREE (auth_file);
*error = -1;
return;
}
- FREE (auth_file);
+ GF_FREE (auth_file);
authenticate = dlsym (handle, "gf_auth");
if (!authenticate) {
@@ -86,14 +86,16 @@ init (dict_t *this,
return;
}
- auth_handle = CALLOC (1, sizeof (*auth_handle));
+ auth_handle = GF_CALLOC (1, sizeof (*auth_handle),
+ gf_common_mt_auth_handle_t);
if (!auth_handle) {
gf_log ("authenticate", GF_LOG_ERROR, "Out of memory");
dict_set (this, key, data_from_dynptr (NULL, 0));
*error = -1;
return;
}
- auth_handle->vol_opt = CALLOC (1, sizeof (volume_opt_list_t));
+ auth_handle->vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t),
+ gf_common_mt_volume_opt_list_t);
auth_handle->vol_opt->given_opt = dlsym (handle, "options");
if (auth_handle->vol_opt->given_opt == NULL) {
gf_log ("authenticate", GF_LOG_DEBUG,