freebsd-dev/lib/libc/resolv
Don Lewis d7f12eacbb Don't leak addrinfo if ai->ai_addrlen <= minsiz test fails.
If the ai->ai_addrlen <= minsiz test fails, then freeaddrinfo()
does not get called to free the memory just allocated by getaddrinfo().
Fix by moving ai->ai_addrlen <= minsiz to a separate nested if
block, and keep freeaddrinfo() in the outer block so that freeaddrinfo()
will be called whenever getaddrinfo() succeeds.

Reported by:	Coverity
CID:		1273652
Reviewed by:	ume
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D6756
2016-06-08 09:40:06 +00:00
..
h_errno.c Add declarations to eliminate -Wmissing-prototypes warnings 2015-09-20 04:26:55 +00:00
herror.c libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
Makefile.inc Update our stub resolver to final version of libbind. 2014-08-12 12:36:06 +00:00
mtctxres.c libc: replace 0 with NULL for pointers. 2016-04-10 19:33:58 +00:00
res_comp.c libc: spelling fixes. 2016-04-30 01:24:24 +00:00
res_data.c libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
res_debug.c libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
res_debug.h
res_findzonecut.c libc: spelling fixes. 2016-04-30 01:24:24 +00:00
res_init.c Don't leak addrinfo if ai->ai_addrlen <= minsiz test fails. 2016-06-08 09:40:06 +00:00
res_mkquery.c libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
res_mkupdate.c libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
res_private.h resolver: preserve binary compatibility; reduce header pollution 2015-12-14 17:21:06 +00:00
res_query.c Since rdata is only used as an argument to the immediately following 2016-05-16 01:38:24 +00:00
res_send.c libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
res_state.c resolver: preserve binary compatibility; reduce header pollution 2015-12-14 17:21:06 +00:00
res_update.c Update our stub resolver to final version of libbind. 2014-08-12 12:36:06 +00:00
Symbol.map Update our stub resolver to final version of libbind. 2014-08-12 12:36:06 +00:00