summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/src/marker.c
diff options
context:
space:
mode:
authorJunaid <junaid@gluster.com>2011-03-31 04:28:26 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-31 05:04:26 -0700
commit1c148f85c5abf561faeb68c699a13c8bd683de5e (patch)
tree97c2a75c55d48ea1bce5cc7c6744f22882ee132c /xlators/features/marker/src/marker.c
parent99779326d09f7ac98bb75bb1432d53c7c320a5c9 (diff)
features/marker: Fix memory corruption.
Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2629 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2629
Diffstat (limited to 'xlators/features/marker/src/marker.c')
-rw-r--r--xlators/features/marker/src/marker.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 43bb58cd8..4062b8d0b 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -1886,11 +1886,17 @@ err:
int32_t
marker_forget (xlator_t *this, inode_t *inode)
{
- marker_inode_ctx_t *ctx = NULL;
+ marker_inode_ctx_t *ctx = NULL;
+ uint64_t value = 0;
- if (inode_ctx_del (inode, this, (uint64_t *) &ctx) != 0)
+ if (inode_ctx_del (inode, this, &value) != 0)
goto out;
+ ctx = (marker_inode_ctx_t *)(unsigned long)value;
+ if (ctx == NULL) {
+ goto out;
+ }
+
quota_forget (this, ctx->quota_ctx);
GF_FREE (ctx);