]> The Tcpdump Group git mirrors - libpcap/blobdiff - gencode.c
Plug memory leaks from pcap_nametoaddrinfo() w/o INET6.
[libpcap] / gencode.c
index eed4863cbb7189c5730d1fb5ddec4969295dfb3e..b593079da607b6785b4924073a1fff03fe0db69f 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -1146,9 +1146,7 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
 
        initchunks(&cstate);
        cstate.no_optimize = 0;
 
        initchunks(&cstate);
        cstate.no_optimize = 0;
-#ifdef INET6
        cstate.ai = NULL;
        cstate.ai = NULL;
-#endif
        cstate.e = NULL;
        cstate.ic.root = NULL;
        cstate.ic.cur_mark = 0;
        cstate.e = NULL;
        cstate.ic.root = NULL;
        cstate.ic.cur_mark = 0;
@@ -1185,10 +1183,8 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
                goto quit;
        }
        if (pcap_parse(scanner, &cstate) != 0) {
                goto quit;
        }
        if (pcap_parse(scanner, &cstate) != 0) {
-#ifdef INET6
                if (cstate.ai != NULL)
                        freeaddrinfo(cstate.ai);
                if (cstate.ai != NULL)
                        freeaddrinfo(cstate.ai);
-#endif
                if (cstate.e != NULL)
                        free(cstate.e);
                rc = PCAP_ERROR;
                if (cstate.e != NULL)
                        free(cstate.e);
                rc = PCAP_ERROR;