summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.c
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/src/syncop.c
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/src/syncop.c')
-rw-r--r--libglusterfs/src/syncop.c5
1 files changed, 3 insertions, 2 deletions
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;
}