From e2a4192a42ecda4f431ba8f9a4d47e4e75417659 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=9Fingen?= Date: Thu, 15 Sep 2016 12:28:52 +0200 Subject: [PATCH] zebra: fix bug in nexthop label allocation Label array in nexthop_label struct was not being allocated. --- lib/nexthop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nexthop.c b/lib/nexthop.c index 01771e253c..23ee28b7dc 100644 --- a/lib/nexthop.c +++ b/lib/nexthop.c @@ -171,7 +171,8 @@ nexthop_add_labels (struct nexthop *nexthop, enum lsp_types_t type, int i; nexthop->nh_label_type = type; - nh_label = XCALLOC (MTYPE_NH_LABEL, sizeof (struct nexthop_label)); + nh_label = XCALLOC (MTYPE_NH_LABEL, sizeof (struct nexthop_label) + + num_labels * sizeof (mpls_label_t)); nh_label->num_labels = num_labels; for (i = 0; i < num_labels; i++) nh_label->label[i] = *(label + i); -- 2.39.5