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/asn1 | |
parent | 33fbca83dcd05b77f807fab205c4523b8cfe85b5 (diff) | |
download | openssl-b548a1f11c06ccdfa4f52a539912d22d77ee309e.tar.gz |
free null cleanup finale
Don't check for NULL before calling OPENSSL_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/a_bitstr.c | 3 | ||||
-rw-r--r-- | crypto/asn1/a_enum.c | 3 | ||||
-rw-r--r-- | crypto/asn1/a_gentm.c | 3 | ||||
-rw-r--r-- | crypto/asn1/a_int.c | 9 | ||||
-rw-r--r-- | crypto/asn1/a_mbstr.c | 8 | ||||
-rw-r--r-- | crypto/asn1/a_object.c | 12 | ||||
-rw-r--r-- | crypto/asn1/a_sign.c | 6 | ||||
-rw-r--r-- | crypto/asn1/a_utctm.c | 3 | ||||
-rw-r--r-- | crypto/asn1/ameth_lib.c | 6 | ||||
-rw-r--r-- | crypto/asn1/asn1_gen.c | 9 | ||||
-rw-r--r-- | crypto/asn1/asn1_lib.c | 5 | ||||
-rw-r--r-- | crypto/asn1/asn_mime.c | 30 | ||||
-rw-r--r-- | crypto/asn1/asn_pack.c | 6 | ||||
-rw-r--r-- | crypto/asn1/bio_asn1.c | 3 | ||||
-rw-r--r-- | crypto/asn1/bio_ndef.c | 6 | ||||
-rw-r--r-- | crypto/asn1/f_enum.c | 3 | ||||
-rw-r--r-- | crypto/asn1/f_int.c | 3 | ||||
-rw-r--r-- | crypto/asn1/f_string.c | 3 | ||||
-rw-r--r-- | crypto/asn1/t_x509.c | 6 | ||||
-rw-r--r-- | crypto/asn1/tasn_dec.c | 5 | ||||
-rw-r--r-- | crypto/asn1/tasn_prn.c | 3 | ||||
-rw-r--r-- | crypto/asn1/tasn_scn.c | 3 | ||||
-rw-r--r-- | crypto/asn1/tasn_utl.c | 6 | ||||
-rw-r--r-- | crypto/asn1/x_info.c | 3 | ||||
-rw-r--r-- | crypto/asn1/x_pkey.c | 2 | ||||
-rw-r--r-- | crypto/asn1/x_pubkey.c | 3 | ||||
-rw-r--r-- | crypto/asn1/x_x509.c | 7 |
27 files changed, 54 insertions, 105 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index ba243f1a5f..60b6e6d403 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -168,8 +168,7 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, s = NULL; ret->length = (int)len; - if (ret->data != NULL) - OPENSSL_free(ret->data); + OPENSSL_free(ret->data); ret->data = s; ret->type = V_ASN1_BIT_STRING; if (a != NULL) diff --git a/crypto/asn1/a_enum.c b/crypto/asn1/a_enum.c index 54d6542cbe..4abd80c122 100644 --- a/crypto/asn1/a_enum.c +++ b/crypto/asn1/a_enum.c @@ -75,8 +75,7 @@ int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) a->type = V_ASN1_ENUMERATED; if (a->length < (int)(sizeof(long) + 1)) { - if (a->data != NULL) - OPENSSL_free(a->data); + OPENSSL_free(a->data); if ((a->data = OPENSSL_malloc(sizeof(long) + 1)) != NULL) memset((char *)a->data, 0, sizeof(long) + 1); } diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c index 0e9149a3ca..324496e30c 100644 --- a/crypto/asn1/a_gentm.c +++ b/crypto/asn1/a_gentm.c @@ -243,8 +243,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, ASN1err(ASN1_F_ASN1_GENERALIZEDTIME_ADJ, ERR_R_MALLOC_FAILURE); return (NULL); } - if (s->data != NULL) - OPENSSL_free(s->data); + OPENSSL_free(s->data); s->data = (unsigned char *)p; } diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index b5246a65c3..68a312b97a 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -258,8 +258,7 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, memcpy(s, p, (int)len); } - if (ret->data != NULL) - OPENSSL_free(ret->data); + OPENSSL_free(ret->data); ret->data = s; ret->length = (int)len; if (a != NULL) @@ -327,8 +326,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, p += len; } - if (ret->data != NULL) - OPENSSL_free(ret->data); + OPENSSL_free(ret->data); ret->data = s; ret->length = (int)len; if (a != NULL) @@ -349,8 +347,7 @@ int ASN1_INTEGER_set(ASN1_INTEGER *a, long v) unsigned char buf[sizeof(long) + 1]; if (a->length < (int)(sizeof(long) + 1)) { - if (a->data != NULL) - OPENSSL_free(a->data); + OPENSSL_free(a->data); if ((a->data = OPENSSL_malloc(sizeof(long) + 1)) != NULL) memset((char *)a->data, 0, sizeof(long) + 1); } diff --git a/crypto/asn1/a_mbstr.c b/crypto/asn1/a_mbstr.c index 6935efe09f..2ff496b4fd 100644 --- a/crypto/asn1/a_mbstr.c +++ b/crypto/asn1/a_mbstr.c @@ -190,11 +190,9 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, if (*out) { free_out = 0; dest = *out; - if (dest->data) { - dest->length = 0; - OPENSSL_free(dest->data); - dest->data = NULL; - } + OPENSSL_free(dest->data); + dest->data = NULL; + dest->length = 0; dest->type = str_type; } else { free_out = 1; diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c index 1e76122192..809e9a4112 100644 --- a/crypto/asn1/a_object.c +++ b/crypto/asn1/a_object.c @@ -313,8 +313,7 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, /* once detached we can change it */ if ((data == NULL) || (ret->length < length)) { ret->length = 0; - if (data != NULL) - OPENSSL_free(data); + OPENSSL_free(data); data = OPENSSL_malloc(length); if (data == NULL) { i = ERR_R_MALLOC_FAILURE; @@ -368,16 +367,13 @@ void ASN1_OBJECT_free(ASN1_OBJECT *a) #ifndef CONST_STRICT /* disable purely for compile-time strict * const checking. Doing this on a "real" * compile will cause memory leaks */ - if (a->sn != NULL) - OPENSSL_free((void *)a->sn); - if (a->ln != NULL) - OPENSSL_free((void *)a->ln); + OPENSSL_free((void*)a->sn); + OPENSSL_free((void*)a->ln); #endif a->sn = a->ln = NULL; } if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) { - if (a->data != NULL) - OPENSSL_free((void *)a->data); + OPENSSL_free((void*)a->data); a->data = NULL; a->length = 0; } diff --git a/crypto/asn1/a_sign.c b/crypto/asn1/a_sign.c index fb7536d84e..e189958174 100644 --- a/crypto/asn1/a_sign.c +++ b/crypto/asn1/a_sign.c @@ -190,8 +190,7 @@ int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2, ASN1err(ASN1_F_ASN1_SIGN, ERR_R_EVP_LIB); goto err; } - if (signature->data != NULL) - OPENSSL_free(signature->data); + OPENSSL_free(signature->data); signature->data = buf_out; buf_out = NULL; signature->length = outl; @@ -300,8 +299,7 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_EVP_LIB); goto err; } - if (signature->data != NULL) - OPENSSL_free(signature->data); + OPENSSL_free(signature->data); signature->data = buf_out; buf_out = NULL; signature->length = outl; diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index 0e2f1b0c40..5fd1a6a3c4 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -218,8 +218,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, ASN1err(ASN1_F_ASN1_UTCTIME_ADJ, ERR_R_MALLOC_FAILURE); goto err; } - if (s->data != NULL) - OPENSSL_free(s->data); + OPENSSL_free(s->data); s->data = (unsigned char *)p; } diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c index 5c7d6bb207..718aa521c5 100644 --- a/crypto/asn1/ameth_lib.c +++ b/crypto/asn1/ameth_lib.c @@ -384,10 +384,8 @@ void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth) { if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) { - if (ameth->pem_str) - OPENSSL_free(ameth->pem_str); - if (ameth->info) - OPENSSL_free(ameth->info); + OPENSSL_free(ameth->pem_str); + OPENSSL_free(ameth->info); OPENSSL_free(ameth); } } diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index 3e066bc3e8..6756c67a47 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -280,10 +280,8 @@ static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth, ret = d2i_ASN1_TYPE(NULL, &cp, len); err: - if (orig_der) - OPENSSL_free(orig_der); - if (new_der) - OPENSSL_free(new_der); + OPENSSL_free(orig_der); + OPENSSL_free(new_der); return ret; @@ -510,8 +508,7 @@ static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf, bad: - if (der) - OPENSSL_free(der); + OPENSSL_free(der); sk_ASN1_TYPE_pop_free(sk, ASN1_TYPE_free); if (sect) diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index a892d7f063..e1e509b3ec 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -335,8 +335,7 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len) void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len) { - if (str->data) - OPENSSL_free(str->data); + OPENSSL_free(str->data); str->data = data; str->length = len; } @@ -366,7 +365,7 @@ void ASN1_STRING_free(ASN1_STRING *a) { if (a == NULL) return; - if (a->data && !(a->flags & ASN1_STRING_FLAG_NDEF)) + if (!(a->flags & ASN1_STRING_FLAG_NDEF)) OPENSSL_free(a->data); OPENSSL_free(a); } diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index 9b397aeaa0..e8411a82ad 100644 --- a/crypto/asn1/asn_mime.c +++ b/crypto/asn1/asn_mime.c @@ -854,12 +854,9 @@ static MIME_HEADER *mime_hdr_new(char *name, char *value) return mhdr; err: - if (tmpname != NULL) - OPENSSL_free(tmpname); - if (tmpval != NULL) - OPENSSL_free(tmpval); - if (mhdr != NULL) - OPENSSL_free(mhdr); + OPENSSL_free(tmpname); + OPENSSL_free(tmpval); + OPENSSL_free(mhdr); return NULL; } @@ -895,12 +892,9 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value) goto err; return 1; err: - if (tmpname != NULL) - OPENSSL_free(tmpname); - if (tmpval != NULL) - OPENSSL_free(tmpval); - if (mparam != NULL) - OPENSSL_free(mparam); + OPENSSL_free(tmpname); + OPENSSL_free(tmpval); + OPENSSL_free(mparam); return 0; } @@ -947,10 +941,8 @@ static MIME_PARAM *mime_param_find(MIME_HEADER *hdr, char *name) static void mime_hdr_free(MIME_HEADER *hdr) { - if (hdr->name) - OPENSSL_free(hdr->name); - if (hdr->value) - OPENSSL_free(hdr->value); + OPENSSL_free(hdr->name); + OPENSSL_free(hdr->value); if (hdr->params) sk_MIME_PARAM_pop_free(hdr->params, mime_param_free); OPENSSL_free(hdr); @@ -958,10 +950,8 @@ static void mime_hdr_free(MIME_HEADER *hdr) static void mime_param_free(MIME_PARAM *param) { - if (param->param_name) - OPENSSL_free(param->param_name); - if (param->param_value) - OPENSSL_free(param->param_value); + OPENSSL_free(param->param_name); + OPENSSL_free(param->param_value); OPENSSL_free(param); } diff --git a/crypto/asn1/asn_pack.c b/crypto/asn1/asn_pack.c index 8d0f0b091f..e358a8676f 100644 --- a/crypto/asn1/asn_pack.c +++ b/crypto/asn1/asn_pack.c @@ -77,10 +77,8 @@ ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) } else octmp = *oct; - if (octmp->data) { - OPENSSL_free(octmp->data); - octmp->data = NULL; - } + OPENSSL_free(octmp->data); + octmp->data = NULL; if (!(octmp->length = ASN1_item_i2d(obj, &octmp->data, it))) { ASN1err(ASN1_F_ASN1_ITEM_PACK, ASN1_R_ENCODE_ERROR); diff --git a/crypto/asn1/bio_asn1.c b/crypto/asn1/bio_asn1.c index d4be23c190..ba39069374 100644 --- a/crypto/asn1/bio_asn1.c +++ b/crypto/asn1/bio_asn1.c @@ -183,8 +183,7 @@ static int asn1_bio_free(BIO *b) if (ctx == NULL) return 0; - if (ctx->buf) - OPENSSL_free(ctx->buf); + OPENSSL_free(ctx->buf); OPENSSL_free(ctx); b->init = 0; b->ptr = NULL; diff --git a/crypto/asn1/bio_ndef.c b/crypto/asn1/bio_ndef.c index 99ab5f66e1..de517f22e4 100644 --- a/crypto/asn1/bio_ndef.c +++ b/crypto/asn1/bio_ndef.c @@ -143,8 +143,7 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it) err: BIO_free(asn_bio); - if (ndef_aux) - OPENSSL_free(ndef_aux); + OPENSSL_free(ndef_aux); return NULL; } @@ -186,8 +185,7 @@ static int ndef_prefix_free(BIO *b, unsigned char **pbuf, int *plen, ndef_aux = *(NDEF_SUPPORT **)parg; - if (ndef_aux->derbuf) - OPENSSL_free(ndef_aux->derbuf); + OPENSSL_free(ndef_aux->derbuf); ndef_aux->derbuf = NULL; *pbuf = NULL; diff --git a/crypto/asn1/f_enum.c b/crypto/asn1/f_enum.c index 2ec99a51a3..338a02e291 100644 --- a/crypto/asn1/f_enum.c +++ b/crypto/asn1/f_enum.c @@ -154,8 +154,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) sp = OPENSSL_realloc(s, (unsigned int)num + i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE); - if (s != NULL) - OPENSSL_free(s); + OPENSSL_free(s); goto err; } s = sp; diff --git a/crypto/asn1/f_int.c b/crypto/asn1/f_int.c index f74252c45a..5a2d18b582 100644 --- a/crypto/asn1/f_int.c +++ b/crypto/asn1/f_int.c @@ -168,8 +168,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) sp = OPENSSL_realloc_clean(s, slen, num + i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE); - if (s != NULL) - OPENSSL_free(s); + OPENSSL_free(s); goto err; } s = sp; diff --git a/crypto/asn1/f_string.c b/crypto/asn1/f_string.c index 53f8cf3a83..e9dcee8e86 100644 --- a/crypto/asn1/f_string.c +++ b/crypto/asn1/f_string.c @@ -160,8 +160,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) sp = OPENSSL_realloc(s, (unsigned int)num + i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_STRING, ERR_R_MALLOC_FAILURE); - if (s != NULL) - OPENSSL_free(s); + OPENSSL_free(s); goto err; } s = sp; diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c index da73b6dfc8..c32f28efee 100644 --- a/crypto/asn1/t_x509.c +++ b/crypto/asn1/t_x509.c @@ -249,8 +249,7 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, } ret = 1; err: - if (m != NULL) - OPENSSL_free(m); + OPENSSL_free(m); return (ret); } @@ -299,8 +298,7 @@ int X509_ocspid_print(BIO *bp, X509 *x) return (1); err: - if (der != NULL) - OPENSSL_free(der); + OPENSSL_free(der); return (0); } diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c index ef19fcdfae..c5caff7ddd 100644 --- a/crypto/asn1/tasn_dec.c +++ b/crypto/asn1/tasn_dec.c @@ -765,7 +765,7 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, *in = p; ret = 1; err: - if (free_cont && buf.data) + if (free_cont) OPENSSL_free(buf.data); return ret; } @@ -882,8 +882,7 @@ static int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, } /* If we've already allocated a buffer use it */ if (*free_cont) { - if (stmp->data) - OPENSSL_free(stmp->data); + OPENSSL_free(stmp->data); stmp->data = (unsigned char *)cont; /* UGLY CAST! RL */ stmp->length = len; *free_cont = 0; diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index 10974eb7f4..76d584b2ba 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -100,8 +100,7 @@ ASN1_PCTX *ASN1_PCTX_new(void) void ASN1_PCTX_free(ASN1_PCTX *p) { - if (p) - OPENSSL_free(p); + OPENSSL_free(p); } unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p) diff --git a/crypto/asn1/tasn_scn.c b/crypto/asn1/tasn_scn.c index 830540550e..cedea9cb78 100644 --- a/crypto/asn1/tasn_scn.c +++ b/crypto/asn1/tasn_scn.c @@ -86,8 +86,7 @@ ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx)) void ASN1_SCTX_free(ASN1_SCTX *p) { - if (p) - OPENSSL_free(p); + OPENSSL_free(p); } const ASN1_ITEM *ASN1_SCTX_get_item(ASN1_SCTX *p) diff --git a/crypto/asn1/tasn_utl.c b/crypto/asn1/tasn_utl.c index 17318ea587..76e96051bf 100644 --- a/crypto/asn1/tasn_utl.c +++ b/crypto/asn1/tasn_utl.c @@ -154,8 +154,7 @@ void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it) ASN1_ENCODING *enc; enc = asn1_get_enc_ptr(pval, it); if (enc) { - if (enc->enc) - OPENSSL_free(enc->enc); + OPENSSL_free(enc->enc); enc->enc = NULL; enc->len = 0; enc->modified = 1; @@ -170,8 +169,7 @@ int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, if (!enc) return 1; - if (enc->enc) - OPENSSL_free(enc->enc); + OPENSSL_free(enc->enc); enc->enc = OPENSSL_malloc(inlen); if (!enc->enc) return 0; diff --git a/crypto/asn1/x_info.c b/crypto/asn1/x_info.c index 4783fc48a9..5b927efc67 100644 --- a/crypto/asn1/x_info.c +++ b/crypto/asn1/x_info.c @@ -106,7 +106,6 @@ void X509_INFO_free(X509_INFO *x) X509_free(x->x509); X509_CRL_free(x->crl); X509_PKEY_free(x->x_pkey); - if (x->enc_data != NULL) - OPENSSL_free(x->enc_data); + OPENSSL_free(x->enc_data); OPENSSL_free(x); } diff --git a/crypto/asn1/x_pkey.c b/crypto/asn1/x_pkey.c index fc5de8a96f..59e002bd45 100644 --- a/crypto/asn1/x_pkey.c +++ b/crypto/asn1/x_pkey.c @@ -113,7 +113,7 @@ void X509_PKEY_free(X509_PKEY *x) X509_ALGOR_free(x->enc_algor); ASN1_OCTET_STRING_free(x->enc_pkey); EVP_PKEY_free(x->dec_pkey); - if ((x->key_data != NULL) && (x->key_free)) + if (x->key_free) OPENSSL_free(x->key_data); OPENSSL_free(x); } diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index 158c24062e..2605f07013 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -340,8 +340,7 @@ int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj, if (!X509_ALGOR_set0(pub->algor, aobj, ptype, pval)) return 0; if (penc) { - if (pub->public_key->data) - OPENSSL_free(pub->public_key->data); + OPENSSL_free(pub->public_key->data); pub->public_key->data = penc; pub->public_key->length = penclen; /* Set number of unused bits to zero */ diff --git a/crypto/asn1/x_x509.c b/crypto/asn1/x_x509.c index 08bb4bd33c..1b353af844 100644 --- a/crypto/asn1/x_x509.c +++ b/crypto/asn1/x_x509.c @@ -103,8 +103,7 @@ static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, break; case ASN1_OP_D2I_POST: - if (ret->name != NULL) - OPENSSL_free(ret->name); + OPENSSL_free(ret->name); ret->name = X509_NAME_oneline(ret->cert_info->subject, NULL, 0); break; @@ -119,9 +118,7 @@ static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, NAME_CONSTRAINTS_free(ret->nc); sk_IPAddressFamily_pop_free(ret->rfc3779_addr, IPAddressFamily_free); ASIdentifiers_free(ret->rfc3779_asid); - - if (ret->name != NULL) - OPENSSL_free(ret->name); + OPENSSL_free(ret->name); break; } |