From owner-svn-src-all@FreeBSD.ORG Mon Jul 15 19:03:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B4B94376 for ; Mon, 15 Jul 2013 19:03:30 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2B2CD15E for ; Mon, 15 Jul 2013 19:03:29 +0000 (UTC) Received: (qmail 75612 invoked from network); 15 Jul 2013 19:53:17 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 15 Jul 2013 19:53:17 -0000 Message-ID: <51E4477D.30607@freebsd.org> Date: Mon, 15 Jul 2013 21:03:25 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Mikolaj Golub Subject: Re: svn commit: r253210 - in head/sys: conf netinet References: <201307111529.r6BFTPSf016809@svn.freebsd.org> <20130715093615.GC2294@acme.spoerlein.net> <20130715183801.GA7630@gmail.com> In-Reply-To: <20130715183801.GA7630@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?UTF-8?B?VWxyaWNoIFNww7ZybGVpbg==?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 19:03:30 -0000 On 15.07.2013 20:38, Mikolaj Golub wrote: > On Mon, Jul 15, 2013 at 11:36:16AM +0200, Ulrich Spörlein wrote: >> Hey Andre, >> >> I don't see why this commit triggers it, but Coverity Scan found a new >> resource leak in this file. syncache_expand() will leak *s when line >> 1071 is reached. The "failed:" case below correctly frees the resources. >> >> 1068/* how do we find the inp for the new socket? */ >> 22. Condition "sc != &scs", taking true branch >> 1069 if (sc != &scs) >> 1070 syncache_free(sc); >> >> CID null (#1 of 1): Resource leak (RESOURCE_LEAK) >> 23. leaked_storage: Variable "s" going out of scope leaks the storage it points to. >> 1071 return (1); >> 1072failed: >> 1073 if (sc != NULL && sc != &scs) >> 1074 syncache_free(sc); >> 1075 if (s != NULL) >> 1076 free(s, M_TCPLOG); >> 1077 *lsop = NULL; >> 1078 return (0); >> 1079} > > It looks like free(s, M_TCPLOG) is missed in this branch: > > 1043 if ((sc->sc_flags & SCF_TIMESTAMP) && !(to->to_flags & TOF_TS)) { > 1044 if ((s = tcp_log_addrs(inc, th, NULL, NULL))) > 1045 log(LOG_DEBUG, "%s; %s: Timestamp missing, " > 1046 "no action\n", s, __func__); > 1047 } Yes, I just figured that out and prepared a patch. -- Andre