From owner-svn-src-all@FreeBSD.ORG Mon Jul 15 18:38:09 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 D57E4BEB; Mon, 15 Jul 2013 18:38:09 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com [IPv6:2a00:1450:4010:c04::232]) by mx1.freebsd.org (Postfix) with ESMTP id 93921F74; Mon, 15 Jul 2013 18:38:08 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id y6so9558560lbh.9 for ; Mon, 15 Jul 2013 11:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=pbEaf6flCnBVtal4TyyubQPMGJnWv85q2uSeTDtxV1g=; b=q7BpN/GH4EGuBKyXjC7g9LfcFRhz4PfOcXWMo5RYHF5eMIZk6hq1eP3lcHjqCaz+R+ 0KPUmVUg2AUw3xWhhhi0LNJNvcsUDALMlCvRrbSKDFX/ccX0JuWkkILDUhuUQ5lSJbVK Ej1KIlr/co6sKq/Dgfy0KkV3yMo/ne/r9HE9VmGXANdEzpZInHDRR+mH13qWL+NZNeg9 Q7T11yEnyRHLU5AisTGdpP8UekyyCjg1sKwPdQphYirns5y5Y9o/bYSUKs6mWPEuNVW5 086Mlo+tum5Nv8dHdWu2mnhJb6hHtM+nCI4Pj9s83sCB6mmAqFr7NurO7jf2joCVFKqR mxmg== X-Received: by 10.112.89.42 with SMTP id bl10mr2019652lbb.77.1373913487329; Mon, 15 Jul 2013 11:38:07 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id u1sm19619187lag.5.2013.07.15.11.38.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 15 Jul 2013 11:38:06 -0700 (PDT) Sender: Mikolaj Golub Date: Mon, 15 Jul 2013 21:38:03 +0300 From: Mikolaj Golub To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Andre Oppermann , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r253210 - in head/sys: conf netinet Message-ID: <20130715183801.GA7630@gmail.com> References: <201307111529.r6BFTPSf016809@svn.freebsd.org> <20130715093615.GC2294@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20130715093615.GC2294@acme.spoerlein.net> User-Agent: Mutt/1.5.21 (2010-09-15) 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 18:38:09 -0000 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 } -- Mikolaj Golub