From 53b24b46c6e265f0d30e46ad635d09dbddaade3b Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 7 Jun 2011 05:50:55 +0000 Subject: pump: cleanup potential dict related memory corruption. Signed-off-by: Krishnan Parthasarathi Signed-off-by: Anand Avati BUG: 2489 (GlusterFS crashing with replace-brick) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2489 --- libglusterfs/src/mem-types.h | 3 ++- libglusterfs/src/syncop.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/mem-types.h b/libglusterfs/src/mem-types.h index 9840dac4375..0ebfc9ecef8 100644 --- a/libglusterfs/src/mem-types.h +++ b/libglusterfs/src/mem-types.h @@ -98,6 +98,7 @@ enum gf_common_mem_types_ { gf_common_mt_sge = 73, gf_common_mt_rpcclnt_cb_program_t = 74, gf_common_mt_libxl_marker_local = 75, - gf_common_mt_end = 76 + gf_common_mt_int32_t = 76, + gf_common_mt_end = 77 }; #endif diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 267e4b3a2d1..a341b92d999 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -291,7 +291,7 @@ syncop_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret == 0) { args->iatt1 = *iatt; - args->xattr = xattr; + args->xattr = dict_ref (xattr); args->iatt2 = *parent; } @@ -313,10 +313,11 @@ syncop_lookup (xlator_t *subvol, loc_t *loc, dict_t *xattr_req, if (iatt) *iatt = args.iatt1; if (xattr_rsp) - *xattr_rsp = args.xattr; + *xattr_rsp = dict_ref (args.xattr); if (parent) *parent = args.iatt2; + dict_unref (args.xattr); errno = args.op_errno; return args.op_ret; } -- cgit