Hi,

I was browsing through the ping6 code and I noticed that one
particular call to getaddrinfo() didn't have a freeaddrinfo() pair.
All calls to getaddrinfo() should have an equivalent freeaddrinfo(), right?

Attached is a patch that "tries-to-resolve" this very small issue
(applies cleanly on an 8.0p2 kernel source).
Also, I'm not not 100% sure if that is the correct place to call
freeaddrinfo() - I hope someone on the list would be kind enough to
have look.

Cheers!

-- 
There are seven words in this sentence.
diff -ruN ../src/sbin/ping6/ping6.c ../src.mod/sbin/ping6/ping6.c
--- ../src/sbin/ping6/ping6.c	2009-10-25 09:10:29.000000000 +0800
+++ ../src.mod/sbin/ping6/ping6.c	2010-03-13 19:46:45.000000000 +0800
@@ -635,6 +635,8 @@
 	    res->ai_protocol)) < 0)
 		err(1, "socket");
 
+	freeaddrinfo(res);
+
 	/* set the source address if specified. */
 	if ((options & F_SRCADDR) &&
 	    bind(s, (struct sockaddr *)&src, srclen) != 0) {
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to