]> git.ipfire.org Git - oddments/collecty.git/commitdiff
sources: iptables: Initialize r
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 26 Oct 2025 17:55:52 +0000 (17:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 26 Oct 2025 17:55:52 +0000 (17:55 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/sources/iptables.c

index c7e4fec5aea4cda877c2558c904442810d485916..8c90df3aef98a9f4e6963743e2b802cf86801e2f 100644 (file)
@@ -114,7 +114,7 @@ static int iptables_iterate_matches(td_ctx* ctx, td_source* source,
        const struct xt_comment_info* comment = NULL;
        const struct xt_entry_match* match = NULL;
        iptables_comment* c = NULL;
-       int r;
+       int r = 0;
 
        // Start with the first match and determine the end
        const unsigned char* p = rule->elems;
@@ -173,7 +173,7 @@ static int iptables_iterate_table(td_ctx* ctx, td_source* source, const char* ta
                iptables_comment** comments, unsigned int* num_comments) {
        iptc_handle_t* handle = NULL;
        const char* chain = NULL;
-       int r;
+       int r = 0;
 
        // Create a new handle
        handle = iptc_init(table);