Coverity warnings in new FIB code (VPP-484)
[vpp.git] / vnet / vnet / mpls / mpls.c
index be5e882..de57da8 100644 (file)
@@ -744,6 +744,8 @@ vnet_mpls_local_label (vlib_main_t * vm,
   is_ip = 0;
   table_id = 0;
   eos = MPLS_EOS;
+  is_del = 0;
+  local_label = MPLS_LABEL_INVALID;
 
    /* Get a line of input. */
   if (! unformat_user (input, unformat_line_input, line_input))
@@ -818,6 +820,14 @@ vnet_mpls_local_label (vlib_main_t * vm,
 
     }
 
+  if (MPLS_LABEL_INVALID == local_label)
+  {
+      error = clib_error_return (0, "local-label required: %U",
+                                format_unformat_error, input);
+      goto done;
+  }
+
+
   if (is_ip)
   {
       u32 fib_index = fib_table_find(pfx.fp_proto, table_id);