Date: Wed, 1 Jun 2016 17:43:04 +0000 (UTC) From: Don Lewis <truckman@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301153 - stable/10/lib/libfetch Message-ID: <201606011743.u51Hh4lc060223@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: truckman Date: Wed Jun 1 17:43:04 2016 New Revision: 301153 URL: https://svnweb.freebsd.org/changeset/base/301153 Log: MFC r300665 Don't leak addrinfo in fetch_bind() Submitted by: Coverity CID: 1225038 Modified: stable/10/lib/libfetch/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/common.c ============================================================================== --- stable/10/lib/libfetch/common.c Wed Jun 1 17:41:00 2016 (r301152) +++ stable/10/lib/libfetch/common.c Wed Jun 1 17:43:04 2016 (r301153) @@ -256,8 +256,11 @@ fetch_bind(int sd, int af, const char *a if ((err = getaddrinfo(addr, NULL, &hints, &res0)) != 0) return (-1); for (res = res0; res; res = res->ai_next) - if (bind(sd, res->ai_addr, res->ai_addrlen) == 0) + if (bind(sd, res->ai_addr, res->ai_addrlen) == 0) { + freeaddrinfo(res0); return (0); + } + freeaddrinfo(res0); return (-1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606011743.u51Hh4lc060223>