From c2c7db16704a1da97ffe2e411c8014c856231a2a Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 22 Aug 2012 23:52:03 +0530 Subject: dict: no need to memdup() the XDR buffer for dict_unserialize * current memdup() of full buffer is not required as 'dict_unserialize()' does its own memdup() of the value. Change-Id: Iba866b68b753d060ee35bb300ee687e7d293ac82 Signed-off-by: Amar Tumballi BUG: 850917 Reviewed-on: http://review.gluster.org/3845 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Anand Avati --- libglusterfs/src/dict.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h index 050f7ca2f..30246cdb4 100644 --- a/libglusterfs/src/dict.h +++ b/libglusterfs/src/dict.h @@ -45,27 +45,21 @@ typedef struct _data_pair data_pair_t; #define GF_PROTOCOL_DICT_UNSERIALIZE(xl,to,buff,len,ret,ope,labl) do { \ - char *buf = NULL; \ if (!len) \ break; \ to = dict_new(); \ GF_VALIDATE_OR_GOTO (xl->name, to, labl); \ \ - buf = memdup (buff, len); \ - GF_VALIDATE_OR_GOTO (xl->name, buf, labl); \ - \ - ret = dict_unserialize (buf, len, &to); \ + ret = dict_unserialize (buff, len, &to); \ if (ret < 0) { \ gf_log (xl->name, GF_LOG_WARNING, \ "failed to unserialize dictionary (%s)", \ (#to)); \ \ ope = EINVAL; \ - GF_FREE (buf); \ goto labl; \ } \ \ - to->extra_free = buf; \ } while (0) struct _data { -- cgit