summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/syncop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index bbcf5201e..1380d15f3 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -97,10 +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->frame, task->opaque);