-fix off-by-1
authorChristian Grothoff <christian@grothoff.org>
Mon, 20 Jun 2016 19:55:38 +0000 (19:55 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 20 Jun 2016 19:55:38 +0000 (19:55 +0000)
src/util/mq.c

index 33bc077c14da58c3d644fc0f4c5bfae09c3df962..b46e36ddfca5fd0f34438d17fe64f39e5cae4a88 100644 (file)
@@ -395,7 +395,7 @@ GNUNET_MQ_queue_for_callbacks (GNUNET_MQ_SendImpl send,
   if (NULL != handlers)
   {
     for (i=0;NULL != handlers[i].cb; i++) ;
-    mq->handlers = GNUNET_new_array (i,
+    mq->handlers = GNUNET_new_array (i + 1,
                                     struct GNUNET_MQ_MessageHandler);
     memcpy (mq->handlers,
            handlers,