[PATCH 1/2] nullfree: add matches for null free cases from OpenSSL
Stephen Hemminger
stephen at networkplumber.org
Fri Nov 3 00:02:05 CET 2023
OpenSSL functions follow the design parameter that free
of NULL is ok.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
devtools/cocci/nullfree.cocci | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/devtools/cocci/nullfree.cocci b/devtools/cocci/nullfree.cocci
index 9ca3fc2864..c58aad4fb7 100644
--- a/devtools/cocci/nullfree.cocci
+++ b/devtools/cocci/nullfree.cocci
@@ -126,4 +126,13 @@ expression E;
|
- if (E != NULL) trie_free(E);
+ trie_free(E);
+|
+- if (E != NULL) EVP_PKEY_CTX_free(E);
++ EVP_PKEY_CTX_free(E);
+|
+- if (E != NULL) EVP_PKEY_free(E);
++ EVP_PKEY_free(E);
+|
+- if (E != NULL) BN_free(E);
++ BN_free(E);
)
--
2.41.0
More information about the dev
mailing list