summaryrefslogtreecommitdiff
path: root/zebra/zebra_ptm.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-06-15 10:22:29 -0400
committerDonald Sharp <sharpd@nvidia.com>2022-06-15 10:24:01 -0400
commitd9db1a4092300970f9112c67556c1f4e860dabe0 (patch)
tree4f9e21d954a92108f5b7a2464ebd5f3df9554fb1 /zebra/zebra_ptm.c
parentab08ef82307c04c055113515c1893bb741a2f517 (diff)
zebra: stream_dup cannot fail
If stream_dup was unable to actually allocate memory then FRR would crash instead. So let's remove the check for null since it is not needed. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_ptm.c')
-rw-r--r--zebra/zebra_ptm.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c
index fda5ef02cf..3127d2d304 100644
--- a/zebra/zebra_ptm.c
+++ b/zebra/zebra_ptm.c
@@ -1294,10 +1294,6 @@ static void zebra_ptm_send_bfdd(struct stream *msg)
/* Create copy for replication. */
msgc = stream_dup(msg);
- if (msgc == NULL) {
- zlog_debug("%s: not enough memory", __func__);
- return;
- }
/* Send message to all running BFDd daemons. */
for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) {
@@ -1308,10 +1304,6 @@ static void zebra_ptm_send_bfdd(struct stream *msg)
/* Allocate more messages. */
msg = stream_dup(msgc);
- if (msg == NULL) {
- zlog_debug("%s: not enough memory", __func__);
- return;
- }
}
stream_free(msgc);
@@ -1326,10 +1318,6 @@ static void zebra_ptm_send_clients(struct stream *msg)
/* Create copy for replication. */
msgc = stream_dup(msg);
- if (msgc == NULL) {
- zlog_debug("%s: not enough memory", __func__);
- return;
- }
/* Send message to all running client daemons. */
for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) {
@@ -1340,10 +1328,6 @@ static void zebra_ptm_send_clients(struct stream *msg)
/* Allocate more messages. */
msg = stream_dup(msgc);
- if (msg == NULL) {
- zlog_debug("%s: not enough memory", __func__);
- return;
- }
}
stream_free(msgc);