Remove useless NULL checks
authorFdaSilvaYY <fdasilvayy@gmail.com>
Sat, 7 May 2016 16:54:01 +0000 (18:54 +0200)
committerMatt Caswell <matt@openssl.org>
Mon, 23 May 2016 12:37:02 +0000 (13:37 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/dh/dh_meth.c
crypto/dsa/dsa_meth.c
crypto/rsa/rsa_meth.c

index afd47ab..45753b6 100644 (file)
@@ -31,8 +31,7 @@ DH_METHOD *DH_meth_new(const char *name, int flags)
 void DH_meth_free(DH_METHOD *dhm)
 {
     if (dhm != NULL) {
-        if (dhm->name != NULL)
-            OPENSSL_free(dhm->name);
+        OPENSSL_free(dhm->name);
         OPENSSL_free(dhm);
     }
 }
index 5ce9339..1d27cea 100644 (file)
@@ -39,8 +39,7 @@ DSA_METHOD *DSA_meth_new(const char *name, int flags)
 void DSA_meth_free(DSA_METHOD *dsam)
 {
     if (dsam != NULL) {
-        if (dsam->name != NULL)
-            OPENSSL_free(dsam->name);
+        OPENSSL_free(dsam->name);
         OPENSSL_free(dsam);
     }
 }
index bce5ee8..ef0dc97 100644 (file)
@@ -31,8 +31,7 @@ RSA_METHOD *RSA_meth_new(const char *name, int flags)
 void RSA_meth_free(RSA_METHOD *meth)
 {
     if (meth != NULL) {
-        if (meth->name != NULL)
-            OPENSSL_free(meth->name);
+        OPENSSL_free(meth->name);
         OPENSSL_free(meth);
     }
 }