From: ßingen Date: Wed, 22 Mar 2017 10:34:10 +0000 (+0100) Subject: lm: Fix some errors detected by Coverity Scan X-Git-Tag: frr-3.1-dev~27^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=66749b59e1cff01f86597f263979be6205376ec9;p=matthieu%2Ffrr.git lm: Fix some errors detected by Coverity Scan --- diff --git a/ldpd/lde.c b/ldpd/lde.c index 1b444bfe8a..30eca8728b 100644 --- a/ldpd/lde.c +++ b/ldpd/lde.c @@ -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; diff --git a/zebra/label_manager.c b/zebra/label_manager.c index 2e96c4ebaf..9f8378572f 100644 --- a/zebra/label_manager.c +++ b/zebra/label_manager.c @@ -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;