]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: acme: stored value is overwritten before it can be used
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 15 Apr 2025 09:44:45 +0000 (11:44 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 15 Apr 2025 09:44:45 +0000 (11:44 +0200)
   >>>     CID 1609049:  Code maintainability issues  (UNUSED_VALUE)
   >>>     Assigning value "NULL" to "new_ckchs" here, but that stored value is overwritten before it can be used.
   592             struct ckch_store *old_ckchs, *new_ckchs = NULL;

Coverity reported an issue where a variable is initialized to NULL then
directry overwritten with another value. This doesn't arm but this patch
removes the useless initialization.

Must fix issue #2932.

src/acme.c

index ce7f9684e342b878a933e040adf31c814753de45..044a8d6a06419194a5f572efb21c8ea3059c706e 100644 (file)
@@ -591,7 +591,7 @@ error:
 int acme_update_certificate(struct task *task, struct acme_ctx *ctx, char **errmsg)
 {
        int ret = 1;
-       struct ckch_store *old_ckchs, *new_ckchs = NULL;
+       struct ckch_store *old_ckchs, *new_ckchs;
        struct ckch_inst *ckchi;
 
        new_ckchs = ctx->store;