summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 20:43:09 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-02-26 00:00:44 +0100
commit76f014689093aa8eecc1061e13cc4f8694967a12 (patch)
treed68df7e97b46f672cd944e89e62d823149781d07 /lib
parent*: use array_size instead of raw division (diff)
downloadfrr-76f014689093aa8eecc1061e13cc4f8694967a12.tar.xz
frr-76f014689093aa8eecc1061e13cc4f8694967a12.zip
*: do not check XMALLOC / XCALLOC for null ret
They never return NULL Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/frr_zmq.c4
-rw-r--r--lib/hash.c2
-rw-r--r--lib/pqueue.c2
-rw-r--r--lib/thread.c2
4 files changed, 0 insertions, 10 deletions
diff --git a/lib/frr_zmq.c b/lib/frr_zmq.c
index cfea238d9..7781beae5 100644
--- a/lib/frr_zmq.c
+++ b/lib/frr_zmq.c
@@ -176,8 +176,6 @@ int funcname_frrzmq_thread_add_read(struct thread_master *master,
cb = *cbp;
else {
cb = XCALLOC(MTYPE_ZEROMQ_CB, sizeof(struct frrzmq_cb));
- if (!cb)
- return -1;
cb->write.cancelled = 1;
*cbp = cb;
@@ -286,8 +284,6 @@ int funcname_frrzmq_thread_add_write(struct thread_master *master,
cb = *cbp;
else {
cb = XCALLOC(MTYPE_ZEROMQ_CB, sizeof(struct frrzmq_cb));
- if (!cb)
- return -1;
cb->read.cancelled = 1;
*cbp = cb;
diff --git a/lib/hash.c b/lib/hash.c
index 9f9fc31d3..611fd33fb 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -95,8 +95,6 @@ static void hash_expand(struct hash *hash)
new_index = XCALLOC(MTYPE_HASH_INDEX,
sizeof(struct hash_bucket *) * new_size);
- if (new_index == NULL)
- return;
hash->stats.empty = new_size;
diff --git a/lib/pqueue.c b/lib/pqueue.c
index 1565de216..87b54a681 100644
--- a/lib/pqueue.c
+++ b/lib/pqueue.c
@@ -133,8 +133,6 @@ static int pqueue_expand(struct pqueue *queue)
newarray =
XCALLOC(MTYPE_PQUEUE_DATA, queue->array_size * DATA_SIZE * 2);
- if (newarray == NULL)
- return 0;
memcpy(newarray, queue->array, queue->array_size * DATA_SIZE);
diff --git a/lib/thread.c b/lib/thread.c
index 055587434..e757ff639 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -414,8 +414,6 @@ struct thread_master *thread_master_create(const char *name)
pthread_once(&init_once, &initializer);
rv = XCALLOC(MTYPE_THREAD_MASTER, sizeof(struct thread_master));
- if (rv == NULL)
- return NULL;
/* Initialize master mutex */
pthread_mutex_init(&rv->mtx, NULL);