From efa7dd64443f246004751bdaa5671bf6836e07ff Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Fri, 1 May 2015 10:15:18 -0400 Subject: 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 --- crypto/ts/ts_asn1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crypto/ts/ts_asn1.c') 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; -- cgit v1.2.3