summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2011-06-07 05:50:55 +0000
committerAnand Avati <avati@gluster.com>2011-06-08 11:18:16 -0700
commit53b24b46c6e265f0d30e46ad635d09dbddaade3b (patch)
tree0125dab37cf4485d4bb8cdc90e310e397bab182c /libglusterfs
parenta48fa5a64bdc1eb25977629d733314e133c7459d (diff)
pump: cleanup potential dict related memory corruption.
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2489 (GlusterFS crashing with replace-brick) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2489
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/mem-types.h3
-rw-r--r--libglusterfs/src/syncop.c5
2 files changed, 5 insertions, 3 deletions
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;
}