diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 16:15:18 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 16:15:18 +0200 |
commit | efa7dd64443f246004751bdaa5671bf6836e07ff (patch) | |
tree | df55d807a97d046ce17eb12adca78ea36a6038fa /crypto/ts/ts_asn1.c | |
parent | free null cleanup finale (diff) | |
download | openssl-efa7dd64443f246004751bdaa5671bf6836e07ff.tar.xz openssl-efa7dd64443f246004751bdaa5671bf6836e07ff.zip |
free NULL cleanup 11
Don't check for NULL before calling free functions. This gets:
ERR_STATE_free
ENGINE_free
DSO_free
CMAC_CTX_free
COMP_CTX_free
CONF_free
NCONF_free NCONF_free_data _CONF_free_data
A sk_free use within OBJ_sigid_free
TS_TST_INFO_free (rest of TS_ API was okay)
Doc update for UI_free (all uses were fine)
X509V3_conf_free
X509V3_section_free
X509V3_string_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/ts/ts_asn1.c')
-rw-r--r-- | crypto/ts/ts_asn1.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/ts/ts_asn1.c b/crypto/ts/ts_asn1.c index 7c741d9691..99b686f39d 100644 --- a/crypto/ts/ts_asn1.c +++ b/crypto/ts/ts_asn1.c @@ -189,8 +189,7 @@ static int ts_resp_set_tst_info(TS_RESP *a) TSerr(TS_F_TS_RESP_SET_TST_INFO, TS_R_TOKEN_PRESENT); return 0; } - if (a->tst_info != NULL) - TS_TST_INFO_free(a->tst_info); + TS_TST_INFO_free(a->tst_info); a->tst_info = PKCS7_to_TS_TST_INFO(a->token); if (!a->tst_info) { TSerr(TS_F_TS_RESP_SET_TST_INFO, @@ -212,8 +211,7 @@ static int ts_resp_cb(int op, ASN1_VALUE **pval, const ASN1_ITEM *it, if (op == ASN1_OP_NEW_POST) { ts_resp->tst_info = NULL; } else if (op == ASN1_OP_FREE_POST) { - if (ts_resp->tst_info != NULL) - TS_TST_INFO_free(ts_resp->tst_info); + TS_TST_INFO_free(ts_resp->tst_info); } else if (op == ASN1_OP_D2I_POST) { if (ts_resp_set_tst_info(ts_resp) == 0) return 0; |