summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/syncop.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index f8709455b..3ed5405af 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -97,9 +97,15 @@ synctask_wake (struct synctask *task)
void
-synctask_wrap (struct synctask *task)
+synctask_wrap (struct synctask *old_task)
{
int ret;
+ struct synctask *task = NULL;
+
+ /* Do not trust the pointer received. It may be
+ wrong and can lead to crashes. */
+
+ task = synctask_get ();
ret = task->syncfn (task->opaque);
task->synccbk (ret, task->opaque);