]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
kdig/dnstap: mitigate segfault
authorJan Doskočil <jan.doskocil@nic.cz>
Thu, 4 Dec 2025 10:29:35 +0000 (11:29 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Thu, 4 Dec 2025 11:31:38 +0000 (12:31 +0100)
src/utils/kdig/kdig_exec.c

index 4a47c4f09940b27297d9cb540bc98c9c3e5d59bc..ab14acbffd3f38fcf916616192c87506c5a0c649 100644 (file)
@@ -899,6 +899,8 @@ static int process_query(const query_t *query, net_t *net)
                                                           &query->style);
                                // If error try next resolved address.
                                if (ret != 0) {
+                                       free(net->local_info);
+                                       net->local_info = NULL;
                                        net->srv = net->srv->ai_next;
                                        if (net->srv != NULL && query->style.show_query) {
                                                printf("\n");