The ThreadService::find_deadlocks_at_safepoint method
leaks on DeadlockCycle object every time it is called.
A DeadlockCycle object, referenced by the 'cycle' local
variable, is pre-allocated and used to store blocked
threads. If a deadlock is found, 'cycle' is added to the
deadlock list (referenced by the 'deadlocks' local
variable) and a new DeadlockCycle object is created and
re-assign to the 'cycle' variable.
Once all the threads have been processed, the deadlock
list is returned, or NULL if no deadlock has been
found. In both case, the last DeadlockCycle object
that has been allocated, still referenced by 'cycle',
is not returned to caller method nor deallocated,
causing the memory leak.
The fix is to call delete on the object pointed by
'cycle' before returning the result.