]> The Tcpdump Group git mirrors - libpcap/commitdiff
Fix memory leak.
authorGuy Harris <[email protected]>
Fri, 30 Nov 2012 20:29:01 +0000 (12:29 -0800)
committerGuy Harris <[email protected]>
Fri, 30 Nov 2012 20:29:32 +0000 (12:29 -0800)
All praise to the Clang Static Humiliator, which found this.

nametoaddr.c

index 5835e4d1fd16414ae612eadc087ad8444e8231dd..c0e86f43ab3b0bda18b104a75f09ae6bca915c4a 100644 (file)
@@ -247,6 +247,7 @@ pcap_nametoportrange(const char *name, int *port1, int *port2, int *proto)
                        free(cpy);
                        return 0;
                }
                        free(cpy);
                        return 0;
                }
+               free(cpy);
 
                if (*proto != save_proto)
                        *proto = PROTO_UNDEF;
 
                if (*proto != save_proto)
                        *proto = PROTO_UNDEF;