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

free NULL cleanup



This commit handles BIO_ACCEPT_free BIO_CB_FREE BIO_CONNECT_free
BIO_free BIO_free_all BIO_vfree

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
parent 2011b169
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -1114,7 +1114,6 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
        goto end;
    }
 end:
    if (key != NULL)
    BIO_free(key);
    if (pkey == NULL)
        BIO_printf(err, "unable to load %s\n", key_descrip);
@@ -1682,7 +1681,6 @@ BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
        ai = NULL;
    }
 err:
    if (in != NULL)
    BIO_free(in);
    if (ai != NULL)
        ASN1_INTEGER_free(ai);
@@ -1741,7 +1739,6 @@ int save_serial(char *serialfile, char *suffix, BIGNUM *serial,
        ai = NULL;
    }
 err:
    if (out != NULL)
    BIO_free_all(out);
    if (ai != NULL)
        ASN1_INTEGER_free(ai);
@@ -1896,7 +1893,6 @@ CA_DB *load_index(char *dbfile, DB_ATTR *db_attr)
        NCONF_free(dbattr_conf);
    if (tmpdb)
        TXT_DB_free(tmpdb);
    if (in)
    BIO_free_all(in);
    return retdb;
}
+3 −6
Original line number Diff line number Diff line
@@ -370,11 +370,8 @@ int MAIN(int argc, char **argv)
    ret = 0;
 end:
    BIO_free(derout);
    if (in != NULL)
    BIO_free(in);
    if (out != NULL)
    BIO_free_all(out);
    if (b64 != NULL)
    BIO_free(b64);
    if (ret != 0)
        ERR_print_errors(bio_err);
+1 −2
Original line number Diff line number Diff line
@@ -1566,7 +1566,6 @@ static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
 err:
    if (req != NULL)
        X509_REQ_free(req);
    if (in != NULL)
    BIO_free(in);
    return (ok);
}
+1 −2
Original line number Diff line number Diff line
@@ -227,7 +227,6 @@ int MAIN(int argc, char **argv)
        SSL_CTX_free(ctx);
    if (ssl != NULL)
        SSL_free(ssl);
    if (STDout != NULL)
    BIO_free_all(STDout);
    apps_shutdown();
    OPENSSL_EXIT(ret);
+3 −6
Original line number Diff line number Diff line
@@ -268,9 +268,7 @@ int MAIN(int argc, char **argv)
    }
    ret = 0;
 end:
    if (in != NULL)
    BIO_free(in);
    if (out != NULL)
    BIO_free_all(out);
    if (p7 != NULL)
        PKCS7_free(p7);
@@ -326,7 +324,6 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
    ret = count;
 end:
    /* never need to OPENSSL_free x */
    if (in != NULL)
    BIO_free(in);
    if (sk != NULL)
        sk_X509_INFO_free(sk);
Loading