Fix segfault when the root task has output to process.
* subversion/libsvn_subr/task.c
(remove_task): Make sure we don't access the RESULTS after freeing
the memory.
git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1888588 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/subversion/libsvn_subr/task.c b/subversion/libsvn_subr/task.c
index 18343fd..80cfbf2 100644
--- a/subversion/libsvn_subr/task.c
+++ b/subversion/libsvn_subr/task.c
@@ -466,6 +466,12 @@
if (parent->last_sub == task)
parent->last_sub = NULL;
}
+ else
+ {
+ /* Root task. Keep it because we might rely on it being present.
+ * However, make sure nobody tries to process its outputs twice. */
+ task->results = NULL;
+ }
return SVN_NO_ERROR;
}