diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
commit | b548a1f11c06ccdfa4f52a539912d22d77ee309e (patch) | |
tree | 37ff8792ddf09e4805aa3ba76b805923d3c52734 /crypto/x509/x_name.c | |
parent | 33fbca83dcd05b77f807fab205c4523b8cfe85b5 (diff) |
free null cleanup finale
Don't check for NULL before calling OPENSSL_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/x509/x_name.c')
-rw-r--r-- | crypto/x509/x_name.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/x509/x_name.c b/crypto/x509/x_name.c index cdc4c973b3..cab7171474 100644 --- a/crypto/x509/x_name.c +++ b/crypto/x509/x_name.c @@ -166,8 +166,7 @@ static void x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) BUF_MEM_free(a->bytes); sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free); - if (a->canon_enc) - OPENSSL_free(a->canon_enc); + OPENSSL_free(a->canon_enc); OPENSSL_free(a); *pval = NULL; } @@ -343,10 +342,8 @@ static int x509_name_canon(X509_NAME *a) X509_NAME_ENTRY *entry, *tmpentry = NULL; int i, set = -1, ret = 0; - if (a->canon_enc) { - OPENSSL_free(a->canon_enc); - a->canon_enc = NULL; - } + OPENSSL_free(a->canon_enc); + a->canon_enc = NULL; /* Special case: empty X509_NAME => null encoding */ if (sk_X509_NAME_ENTRY_num(a->entries) == 0) { a->canon_enclen = 0; |