diff options
author | 2014-05-30 06:24:16 +0000 | |
---|---|---|
committer | 2014-05-30 06:24:16 +0000 | |
commit | f3f95c1e98f301fcfcdcd65ade3c29d5455d65cb (patch) | |
tree | 4826709437a1aa6a5868f1216c440fc8bfa921a8 /lib | |
parent | more: no need for null check before free (diff) | |
download | wireguard-openbsd-f3f95c1e98f301fcfcdcd65ade3c29d5455d65cb.tar.xz wireguard-openbsd-f3f95c1e98f301fcfcdcd65ade3c29d5455d65cb.zip |
more: no need to null check before free; ok guenther
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/dh/dh_ameth.c | 2 | ||||
-rw-r--r-- | lib/libcrypto/dsa/dsa_ameth.c | 2 | ||||
-rw-r--r-- | lib/libcrypto/rsa/rsa_ameth.c | 2 | ||||
-rw-r--r-- | lib/libcrypto/rsa/rsa_oaep.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/crypto/dh/dh_ameth.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/crypto/dsa/dsa_ameth.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/crypto/rsa/rsa_ameth.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/crypto/rsa/rsa_oaep.c | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/lib/libcrypto/dh/dh_ameth.c b/lib/libcrypto/dh/dh_ameth.c index 119ac615a6e..fe3dfc40d1d 100644 --- a/lib/libcrypto/dh/dh_ameth.c +++ b/lib/libcrypto/dh/dh_ameth.c @@ -382,7 +382,7 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, err: DHerr(DH_F_DO_DH_PRINT,reason); } - if (m != NULL) free(m); + free(m); return(ret); } diff --git a/lib/libcrypto/dsa/dsa_ameth.c b/lib/libcrypto/dsa/dsa_ameth.c index e2c3980e565..c6d04f6a5d5 100644 --- a/lib/libcrypto/dsa/dsa_ameth.c +++ b/lib/libcrypto/dsa/dsa_ameth.c @@ -481,7 +481,7 @@ static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) if (!ASN1_bn_print(bp,"G: ",x->g,m,off)) goto err; ret=1; err: - if (m != NULL) free(m); + free(m); return(ret); } diff --git a/lib/libcrypto/rsa/rsa_ameth.c b/lib/libcrypto/rsa/rsa_ameth.c index f0a346a70ec..2c7e39bb1d3 100644 --- a/lib/libcrypto/rsa/rsa_ameth.c +++ b/lib/libcrypto/rsa/rsa_ameth.c @@ -248,7 +248,7 @@ static int do_rsa_print(BIO *bp, const RSA *x, int off, int priv) } ret=1; err: - if (m != NULL) free(m); + free(m); return(ret); } diff --git a/lib/libcrypto/rsa/rsa_oaep.c b/lib/libcrypto/rsa/rsa_oaep.c index a107e89b81c..53d35621a37 100644 --- a/lib/libcrypto/rsa/rsa_oaep.c +++ b/lib/libcrypto/rsa/rsa_oaep.c @@ -179,7 +179,7 @@ decoding_err: /* to avoid chosen ciphertext attacks, the error message should not reveal * which kind of decoding error happened */ RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, RSA_R_OAEP_DECODING_ERROR); - if (db != NULL) free(db); + free(db); return -1; } diff --git a/lib/libssl/src/crypto/dh/dh_ameth.c b/lib/libssl/src/crypto/dh/dh_ameth.c index 119ac615a6e..fe3dfc40d1d 100644 --- a/lib/libssl/src/crypto/dh/dh_ameth.c +++ b/lib/libssl/src/crypto/dh/dh_ameth.c @@ -382,7 +382,7 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, err: DHerr(DH_F_DO_DH_PRINT,reason); } - if (m != NULL) free(m); + free(m); return(ret); } diff --git a/lib/libssl/src/crypto/dsa/dsa_ameth.c b/lib/libssl/src/crypto/dsa/dsa_ameth.c index e2c3980e565..c6d04f6a5d5 100644 --- a/lib/libssl/src/crypto/dsa/dsa_ameth.c +++ b/lib/libssl/src/crypto/dsa/dsa_ameth.c @@ -481,7 +481,7 @@ static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) if (!ASN1_bn_print(bp,"G: ",x->g,m,off)) goto err; ret=1; err: - if (m != NULL) free(m); + free(m); return(ret); } diff --git a/lib/libssl/src/crypto/rsa/rsa_ameth.c b/lib/libssl/src/crypto/rsa/rsa_ameth.c index f0a346a70ec..2c7e39bb1d3 100644 --- a/lib/libssl/src/crypto/rsa/rsa_ameth.c +++ b/lib/libssl/src/crypto/rsa/rsa_ameth.c @@ -248,7 +248,7 @@ static int do_rsa_print(BIO *bp, const RSA *x, int off, int priv) } ret=1; err: - if (m != NULL) free(m); + free(m); return(ret); } diff --git a/lib/libssl/src/crypto/rsa/rsa_oaep.c b/lib/libssl/src/crypto/rsa/rsa_oaep.c index a107e89b81c..53d35621a37 100644 --- a/lib/libssl/src/crypto/rsa/rsa_oaep.c +++ b/lib/libssl/src/crypto/rsa/rsa_oaep.c @@ -179,7 +179,7 @@ decoding_err: /* to avoid chosen ciphertext attacks, the error message should not reveal * which kind of decoding error happened */ RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, RSA_R_OAEP_DECODING_ERROR); - if (db != NULL) free(db); + free(db); return -1; } |