- Cancel task to prevent acessing freed memory
authorBart Polot <bart@net.in.tum.de>
Tue, 14 Feb 2012 10:56:31 +0000 (10:56 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 14 Feb 2012 10:56:31 +0000 (10:56 +0000)
src/testing/testing.c

index 023b607eb9db96663d8b61c4a355cd2b5e4333ac..70da138a7eb36fc83829162320c3a829283a2070 100644 (file)
@@ -1668,6 +1668,8 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
 
   GNUNET_free_non_null (del_arg);
   d->max_timeout = GNUNET_TIME_relative_to_absolute (timeout);
+  if (GNUNET_SCHEDULER_NO_TASK != d->task)
+    GNUNET_SCHEDULER_cancel(d->task);
   d->task = GNUNET_SCHEDULER_add_now (&start_fsm, d);
 }