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

free NULL cleanup

Start ensuring all OpenSSL "free" routines allow NULL, and remove
any if check before calling them.
This gets DH_free, DSA_free, RSA_free

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
parent 1300705a
Loading
Loading
Loading
Loading
+0 −1
Changes for apps/dh.c: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -314,7 +314,6 @@ int MAIN(int argc, char **argv)
        BIO_free(in);
    if (out != NULL)
        BIO_free_all(out);
    if (dh != NULL)
    DH_free(dh);
    apps_shutdown();
    OPENSSL_EXIT(ret);
+0 −2
Changes for apps/dhparam.c: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -319,7 +319,6 @@ int MAIN(int argc, char **argv)
            if (!dsa
                || !DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL,
                                               cb)) {
                if (dsa)
                DSA_free(dsa);
                BN_GENCB_free(cb);
                ERR_print_errors(bio_err);
@@ -520,7 +519,6 @@ int MAIN(int argc, char **argv)
        BIO_free(in);
    if (out != NULL)
        BIO_free_all(out);
    if (dh != NULL)
    DH_free(dh);
    apps_shutdown();
    OPENSSL_EXIT(ret);
+0 −1
Changes for apps/dsa.c: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -360,7 +360,6 @@ int MAIN(int argc, char **argv)
        BIO_free(in);
    if (out != NULL)
        BIO_free_all(out);
    if (dsa != NULL)
    DSA_free(dsa);
    if (passin)
        OPENSSL_free(passin);
+0 −1
Changes for apps/dsaparam.c: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -438,7 +438,6 @@ int MAIN(int argc, char **argv)
        BIO_free(in);
    if (out != NULL)
        BIO_free_all(out);
    if (dsa != NULL)
    DSA_free(dsa);
    apps_shutdown();
    OPENSSL_EXIT(ret);
+0 −1
Changes for apps/gendh.c: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -212,7 +212,6 @@ int MAIN(int argc, char **argv)
        ERR_print_errors(bio_err);
    if (out != NULL)
        BIO_free_all(out);
    if (dh != NULL)
    DH_free(dh);
    if (cb != NULL)
        BN_GENCB_free(cb);
Loading