Commit efa7dd64 authored by Rich Salz's avatar Rich Salz
Browse files

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: default avatarRichard Levitte <levitte@openssl.org>
parent b548a1f1
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1612,7 +1612,6 @@ CA_DB *load_index(char *dbfile, DB_ATTR *db_attr)
    }

 err:
    if (dbattr_conf)
    NCONF_free(dbattr_conf);
    TXT_DB_free(tmpdb);
    BIO_free_all(in);
+1 −2
Original line number Diff line number Diff line
@@ -883,7 +883,6 @@ int req_main(int argc, char **argv)
    if (sigopts)
        sk_OPENSSL_STRING_free(sigopts);
#ifndef OPENSSL_NO_ENGINE
    if (gen_eng)
    ENGINE_free(gen_eng);
#endif
    OPENSSL_free(keyalgstr);
+1 −2
Original line number Diff line number Diff line
@@ -511,7 +511,6 @@ static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
    OPENSSL_free(der);

    sk_ASN1_TYPE_pop_free(sk, ASN1_TYPE_free);
    if (sect)
    X509V3_section_free(cnf, sect);

    return ret;
+1 −2
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ static int do_tcreate(char *value, char *name)
        if (!rv)
            ASN1err(ASN1_F_DO_TCREATE, ERR_R_MALLOC_FAILURE);
    }
    if (lst)
    sk_CONF_VALUE_pop_free(lst, X509V3_conf_free);
    return rv;
}
+1 −2
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ static int cmac_size(const EVP_PKEY *pkey)
static void cmac_key_free(EVP_PKEY *pkey)
{
    CMAC_CTX *cmctx = (CMAC_CTX *)pkey->pkey.ptr;
    if (cmctx)
    CMAC_CTX_free(cmctx);
}

Loading