From 683ce1bca3b6c541e565eec014fa7cc3308957d8 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 22 Feb 2012 18:27:15 +0530 Subject: glusterfsd: unref the dict and use dict_set_dynstr to avoid memleak Unref the new dict and use proper dict api (dict_set_dynstr) to save data for displaying volume status information, which otherwise leads to memory leak in the process. Change-Id: Icb9ceb1a867c5b9759211a67027d983ab9b7e1c2 BUG: 796186 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.com/2799 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libglusterfs/src/inode.c') diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index 67752da71..3fad499eb 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -1652,7 +1652,7 @@ inode_dump_to_dict (inode_t *inode, char *prefix, dict_t *dict) memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "%s.gfid", prefix); - ret = dict_set_str (dict, key, gf_strdup (uuid_utoa (inode->gfid))); + ret = dict_set_dynstr (dict, key, gf_strdup (uuid_utoa (inode->gfid))); if (ret) goto out; -- cgit