]> git.puffer.fish Git - mirror/frr.git/commitdiff
lm: Fix some errors detected by Coverity Scan 288/head
authorßingen <bingen@voltanet.io>
Wed, 22 Mar 2017 10:34:10 +0000 (11:34 +0100)
committerßingen <bingen@voltanet.io>
Wed, 22 Mar 2017 10:34:10 +0000 (11:34 +0100)
ldpd/lde.c
zebra/label_manager.c

index 1b444bfe8a2f81d09fd466aea6bf9372f8fb9e2f..30eca8728bb6fdd396c1e9e49d2698f087f28d01 100644 (file)
@@ -1620,6 +1620,10 @@ on_get_label_chunk_response(uint32_t start, uint32_t end)
        log_debug("Label Chunk assign: %u - %u", start, end);
 
        new_label_chunk = calloc(1, sizeof(struct label_chunk));
+       if (!new_label_chunk) {
+               log_warn("Error trying to allocate label chunk %u - %u", start, end);
+               return;
+       }
 
        new_label_chunk->start = start;
        new_label_chunk->end = end;
index 2e96c4ebaf4e405f473ae34e21a9c91da8579cba..9f8378572fa7afcc5ce9b57d3ed79986484177b8 100644 (file)
@@ -217,6 +217,8 @@ struct label_manager_chunk *assign_label_chunk(u_char proto, u_short instance,
        }
        /* otherwise create a new one */
        lmc = XCALLOC(MTYPE_LM_CHUNK, sizeof(struct label_manager_chunk));
+       if (!lmc)
+               return NULL;
 
        if (list_isempty(lbl_mgr.lc_list))
                lmc->start = MPLS_MIN_UNRESERVED_LABEL;