CLEANUP: ssl: check if a transaction exists once before setting it
trivial patch to fix issue #351
Fixes: bc6ca7ccaa72 ("MINOR: ssl/cli: rework 'set ssl cert' as 'set/commit'")
Reported-by: Илья Шипицин <chipitsine@gmail.com>
Signed-off-by: William Dauchy <w.dauchy@criteo.com>
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index cd04c34..62b9de9 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -10468,7 +10468,7 @@
/* we succeed, we can save the ckchs in the transaction */
/* if there wasn't a transaction, update the old ckchs */
- if (!ckchs_transaction.old_ckchs && !ckchs_transaction.old_ckchs) {
+ if (!ckchs_transaction.old_ckchs) {
ckchs_transaction.old_ckchs = appctx->ctx.ssl.old_ckchs;
ckchs_transaction.path = appctx->ctx.ssl.path;
err = memprintf(&err, "Transaction created for certificate %s!\n", ckchs_transaction.path);