[PATCH 07/82] examples/l2fwd-cat: remove unnecessary NULL checks
Stephen Hemminger
stephen at networkplumber.org
Mon Jan 24 01:04:03 CET 2022
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
examples/l2fwd-cat/cat.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c
index 502c6b32780e..77154c8b7e61 100644
--- a/examples/l2fwd-cat/cat.c
+++ b/examples/l2fwd-cat/cat.c
@@ -872,8 +872,7 @@ cat_fini(void)
#if PQOS_VERSION <= 103
memset(m_sockets, 0, sizeof(m_sockets));
#else
- if (m_sockets != NULL)
- free(m_sockets);
+ free(m_sockets);
#endif
m_sock_count = 0;
memset(m_config, 0, sizeof(m_config));
--
2.30.2
More information about the dev
mailing list