]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
digest: avoid freeing a local variable (clang analyzer)
authorDaniel Salzman <daniel.salzman@nic.cz>
Wed, 17 Sep 2025 06:29:16 +0000 (08:29 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 17 Sep 2025 06:29:16 +0000 (08:29 +0200)
src/knot/zone/digest.c

index c6f03e904700bfa40a91390db6c66b1a49f405d5..5bcb46328b777c5093523651e0d3cd28be0ed099 100644 (file)
@@ -262,7 +262,9 @@ int zone_update_add_digest(struct zone_update *update, int algorithm, bool place
 
                ret = zone_update_remove(update, &exists);
                if (ret != KNOT_EOK && ret != KNOT_ENOENT) {
-                       free(digest);
+                       if (digest != &zero) {
+                               free(digest);
+                       }
                        return ret;
                }
        }