summaryrefslogtreecommitdiffstats
path: root/apps/srp.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/srp.c')
-rw-r--r--apps/srp.c37
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)