diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-08-22 23:52:03 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-10-01 12:51:54 -0700 |
commit | c2c7db16704a1da97ffe2e411c8014c856231a2a (patch) | |
tree | 7e801d8f97b649d15e5f4038e9cd7ab804d6ad41 | |
parent | 3d3222074028900ed1d4866116ba7f4dbef5e614 (diff) |
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 <amarts@redhat.com>
BUG: 850917
Reviewed-on: http://review.gluster.org/3845
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r-- | libglusterfs/src/dict.h | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h index 050f7ca2f72..30246cdb493 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 { |