projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39fdec2
)
-fix use after free, nicer loop
author
Christian Grothoff
<christian@grothoff.org>
Wed, 20 Jun 2012 10:49:24 +0000
(10:49 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Wed, 20 Jun 2012 10:49:24 +0000
(10:49 +0000)
src/testbed/testbed_api.c
patch
|
blob
|
history
diff --git
a/src/testbed/testbed_api.c
b/src/testbed/testbed_api.c
index fc4b86603ba650225b4e9e98b9f860e7c8501f10..4787ea25a1f433757eddd62f590a7412ef919ef4 100644
(file)
--- a/
src/testbed/testbed_api.c
+++ b/
src/testbed/testbed_api.c
@@
-325,9
+325,12
@@
GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_Controller *controller)
if (NULL != controller->th)
GNUNET_CLIENT_notify_transmit_ready_cancel (controller->th);
-
for (mq_entry = controller->mq_head;
/* Clear the message queue */
-
NULL != mq_entry; mq_entry = controller->mq_head
)
+ /* Clear the message queue */
+
while (NULL != (mq_entry = controller->mq_head)
)
{
+ GNUNET_CONTAINER_DLL_remove (controller->mq_head,
+ controller->mq_tail,
+ mq_entry);
GNUNET_free (mq_entry->msg);
GNUNET_free (mq_entry);
}