summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorJunaid <junaid@gluster.com>2011-07-21 23:51:45 +0530
committerAnand Avati <avati@gluster.com>2011-07-28 01:59:04 -0700
commit98b32b5798c7d782cae4c16b608f600ab51fffce (patch)
tree5b92a28fd907a3c5bb36ef604bd45857d18590a9 /xlators/features
parent58e3c67007d52b5c2383badf32d5809edfc0c6cb (diff)
features/marker-quota: Fix some random memory leaks.
Change-Id: I1b01adf1d0ecf494f960d125f2bdcc9c10137115 BUG: 3169 Reviewed-on: http://review.gluster.com/75 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: Raghavendra G <raghavendra@gluster.com> Reviewed-by: Raghavendra G <raghavendra@gluster.com>
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/marker/src/marker-quota.c19
-rw-r--r--xlators/features/marker/src/marker.c4
2 files changed, 11 insertions, 12 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index 8caf5b0c0..7aa33cfaf 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -107,16 +107,6 @@ int32_t
dirty_inode_updation_done (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno)
{
- quota_local_t *local = NULL;
- int32_t value = 0;
-
- local = frame->local;
-
- if (!local->err)
- QUOTA_SAFE_DECREMENT (&local->lock, local->ref, value);
- else
- frame->local = NULL;
-
QUOTA_STACK_DESTROY (frame, this);
return 0;
@@ -317,6 +307,9 @@ err:
release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
}
+ if (dict)
+ dict_unref (dict);
+
return 0;
}
@@ -978,10 +971,15 @@ quota_get_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
STACK_WIND (frame, quota_check_n_set_inode_xattr, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, &local->loc, xattr_req);
+ dict_unref (xattr_req);
+
return 0;
err:
quota_xattr_creation_release_lock (frame, NULL, this, 0, 0);
+
+ if (xattr_req)
+ dict_unref (xattr_req);
return 0;
lock_err:
@@ -1203,7 +1201,6 @@ quota_mark_undirty (call_frame_t *frame,
}
newdict = dict_new ();
-
if (!newdict)
goto err;
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 84c13435f..b4cf50800 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -935,7 +935,9 @@ marker_rename_done (call_frame_t *frame, void *cookie, xlator_t *this,
newloc.inode = inode_ref (oplocal->loc.inode);
newloc.path = gf_strdup (local->loc.path);
- newloc.name = gf_strdup (local->loc.name);
+ newloc.name = strrchr (newloc.path, '/');
+ if (newloc.name)
+ newloc.name++;
newloc.parent = inode_ref (local->loc.parent);
newloc.ino = oplocal->loc.inode->ino;