From 582de0677da4be19fc6f873625c58c45d069ab1c Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Thu, 22 Apr 2010 13:33:09 +0000 Subject: Memory accounting changes Memory accounting Changes. Thanks to Vinayak Hegde and Csaba Henk for their contributions. Signed-off-by: Vijay Bellur Signed-off-by: Anand V. Avati BUG: 329 (Replacing memory allocation functions with mem-type functions) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=329 --- libglusterfs/src/authenticate.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libglusterfs/src/authenticate.c') 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, -- cgit