diff options
Diffstat (limited to 'src/cadet/cadet_api.c')
-rw-r--r-- | src/cadet/cadet_api.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index e20796d17..7b9ac62b3 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c | |||
@@ -2538,7 +2538,16 @@ GNUNET_CADET_open_porT (struct GNUNET_CADET_Handle *h, | |||
2538 | p->cls = connects_cls; | 2538 | p->cls = connects_cls; |
2539 | p->window_changes = window_changes; | 2539 | p->window_changes = window_changes; |
2540 | p->disconnects = disconnects; | 2540 | p->disconnects = disconnects; |
2541 | p->handlers = handlers; | 2541 | if (NULL != handlers) |
2542 | { | ||
2543 | unsigned int i; | ||
2544 | for (i=0;NULL != handlers[i].cb; i++) ; | ||
2545 | p->handlers = GNUNET_new_array (i + 1, | ||
2546 | struct GNUNET_MQ_MessageHandler); | ||
2547 | GNUNET_memcpy ((struct GNUNET_MQ_MessageHandler *) p->handlers, | ||
2548 | handlers, | ||
2549 | i * sizeof (struct GNUNET_MQ_MessageHandler)); | ||
2550 | } | ||
2542 | 2551 | ||
2543 | GNUNET_assert (GNUNET_OK == | 2552 | GNUNET_assert (GNUNET_OK == |
2544 | GNUNET_CONTAINER_multihashmap_put (h->ports, | 2553 | GNUNET_CONTAINER_multihashmap_put (h->ports, |