summaryrefslogtreecommitdiffstats
path: root/ospf6d
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 21:18:13 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-02-26 00:00:46 +0100
commit0a22ddfbb16a61c3e068ea1164e885104366112a (patch)
tree5aeaef43b3de5ebbdfcf1015421eb48b51a071fb /ospf6d
parentlib: STAILQ_FOREACH_SAFE never gives a null elem (diff)
downloadfrr-0a22ddfbb16a61c3e068ea1164e885104366112a.tar.xz
frr-0a22ddfbb16a61c3e068ea1164e885104366112a.zip
*: remove null check before XFREE
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_message.c6
-rw-r--r--ospf6d/ospf6_route.c3
2 files changed, 3 insertions, 6 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index cd688bbf8..4acb5e3b2 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -1505,10 +1505,8 @@ int ospf6_iobuf_size(unsigned int size)
recvnew = XMALLOC(MTYPE_OSPF6_MESSAGE, size);
sendnew = XMALLOC(MTYPE_OSPF6_MESSAGE, size);
- if (recvbuf)
- XFREE(MTYPE_OSPF6_MESSAGE, recvbuf);
- if (sendbuf)
- XFREE(MTYPE_OSPF6_MESSAGE, sendbuf);
+ XFREE(MTYPE_OSPF6_MESSAGE, recvbuf);
+ XFREE(MTYPE_OSPF6_MESSAGE, sendbuf);
recvbuf = recvnew;
sendbuf = sendnew;
iobuflen = size;
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index 79e1a4439..b71b353e1 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -174,8 +174,7 @@ struct ospf6_nexthop *ospf6_nexthop_create(void)
void ospf6_nexthop_delete(struct ospf6_nexthop *nh)
{
- if (nh)
- XFREE(MTYPE_OSPF6_NEXTHOP, nh);
+ XFREE(MTYPE_OSPF6_NEXTHOP, nh);
}
void ospf6_clear_nexthops(struct list *nh_list)