diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
commit | b548a1f11c06ccdfa4f52a539912d22d77ee309e (patch) | |
tree | 37ff8792ddf09e4805aa3ba76b805923d3c52734 /apps/srp.c | |
parent | 33fbca83dcd05b77f807fab205c4523b8cfe85b5 (diff) |
free null cleanup finale
Don't check for NULL before calling OPENSSL_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/srp.c')
-rw-r--r-- | apps/srp.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/apps/srp.c b/apps/srp.c index b984c14c97..960ca822f7 100644 --- a/apps/srp.c +++ b/apps/srp.c @@ -384,10 +384,8 @@ int srp_main(int argc, char **argv) errorline, configfile); goto end; } - if (tofree) { - OPENSSL_free(tofree); - tofree = NULL; - } + OPENSSL_free(tofree); + tofree = NULL; /* Lets get the config section we are using */ if (section == NULL) { @@ -519,26 +517,16 @@ int srp_main(int argc, char **argv) row[DB_srpgN] = BUF_strdup(gNid); if (!row[DB_srpid] || !row[DB_srpgN] || !row[DB_srptype] - || !row[DB_srpverifier] || !row[DB_srpsalt] || (userinfo - && - (!(row - [DB_srpinfo] - = - BUF_strdup - (userinfo)))) + || !row[DB_srpverifier] || !row[DB_srpsalt] + || (userinfo && + (!(row [DB_srpinfo] = BUF_strdup (userinfo)))) || !update_index(db, row)) { - if (row[DB_srpid]) - OPENSSL_free(row[DB_srpid]); - if (row[DB_srpgN]) - OPENSSL_free(row[DB_srpgN]); - if (row[DB_srpinfo]) - OPENSSL_free(row[DB_srpinfo]); - if (row[DB_srptype]) - OPENSSL_free(row[DB_srptype]); - if (row[DB_srpverifier]) - OPENSSL_free(row[DB_srpverifier]); - if (row[DB_srpsalt]) - OPENSSL_free(row[DB_srpsalt]); + OPENSSL_free(row[DB_srpid]); + OPENSSL_free(row[DB_srpgN]); + OPENSSL_free(row[DB_srpinfo]); + OPENSSL_free(row[DB_srptype]); + OPENSSL_free(row[DB_srpverifier]); + OPENSSL_free(row[DB_srpsalt]); goto end; } doupdatedb = 1; @@ -676,8 +664,7 @@ int srp_main(int argc, char **argv) if (verbose) BIO_printf(bio_err, "SRP terminating with code %d.\n", ret); - if (tofree) - OPENSSL_free(tofree); + OPENSSL_free(tofree); if (ret) ERR_print_errors(bio_err); if (randfile) |