CLEANUP: Stop checking the pointer before calling `task_free()`
Changes performed with this Coccinelle patch:
@@
expression e;
@@
- if (e != NULL) {
task_destroy(e);
- }
@@
expression e;
@@
- if (e) {
task_destroy(e);
- }
@@
expression e;
@@
- if (e)
task_destroy(e);
@@
expression e;
@@
- if (e != NULL)
task_destroy(e);
diff --git a/src/mworker.c b/src/mworker.c
index 11d61a2..b1115cc 100644
--- a/src/mworker.c
+++ b/src/mworker.c
@@ -502,8 +502,7 @@
/* disable this peer section so that it kills itself */
if (curpeers->sighandler)
signal_unregister_handler(curpeers->sighandler);
- if (curpeers->sync_task)
- task_destroy(curpeers->sync_task);
+ task_destroy(curpeers->sync_task);
curpeers->sync_task = NULL;
curpeers->peers_fe = NULL;
}