From owner-svn-src-all@freebsd.org Tue Mar 7 16:56:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CF10D02952; Tue, 7 Mar 2017 16:56:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1AC61F7B; Tue, 7 Mar 2017 16:56:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f41.google.com with SMTP id n11so94864298wma.1; Tue, 07 Mar 2017 08:56:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Ecm9Cs2MKK1OwgHlrxCjW92kuU0e3WxjeRyP43Ukd5w=; b=iP+BIVp7Dxn8wb1ez5NrOWQqpeZZPiifFxqVk5wesgqEia5N6HxdeGJ/bGVj0Dcr13 HTO+hB/PKKyA+9OyI2MR+Q2TXCkmFx32DK8KMuKPOq2sgwyZXKVDiUHMrilGW674Z17M beh23RTVJW0Xr6HAn4JiN+3LvHN6po6lbvjmVNclrnyil4nNP0m12vNFPNWsafbi7U7l ZwAv3hblBUOna+e7IkJhYNzfDH5ZSUpxeAPq+x6zOydT7tLQp4mWq+X86rnv7fvTNEaQ K6C9WFynVdZJuxbEt4a6gWhSGfrfBhLi/+7IWhYCpRxAVy6GuK0mh5N3rjlX0n1Ly4zM tX1Q== X-Gm-Message-State: AMke39kEGJ+5Q3WnTAi7xIicoqBuILK9BVpWXgrLAWxPzuxVNMJFeTmtMt/sU4ZEPGprNg== X-Received: by 10.28.43.6 with SMTP id r6mr19071738wmr.0.1488905377182; Tue, 07 Mar 2017 08:49:37 -0800 (PST) Received: from mail-wr0-f174.google.com (mail-wr0-f174.google.com. [209.85.128.174]) by smtp.gmail.com with ESMTPSA id g5sm672028wrb.48.2017.03.07.08.49.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Mar 2017 08:49:37 -0800 (PST) Received: by mail-wr0-f174.google.com with SMTP id l37so5636445wrc.1; Tue, 07 Mar 2017 08:49:36 -0800 (PST) X-Received: by 10.223.145.97 with SMTP id j88mr1120669wrj.178.1488905376833; Tue, 07 Mar 2017 08:49:36 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Tue, 7 Mar 2017 08:49:36 -0800 (PST) In-Reply-To: <20170307153227.GN30979@kib.kiev.ua> References: <201703042046.v24KkvTw062504@repo.freebsd.org> <20170307153227.GN30979@kib.kiev.ua> From: Conrad Meyer Date: Tue, 7 Mar 2017 08:49:36 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r314677 - head/lib/libc/gen To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 07 Mar 2017 16:56:18 -0000 Yes. On Tue, Mar 7, 2017 at 7:32 AM, Konstantin Belousov wrote: > On Sat, Mar 04, 2017 at 08:46:57PM +0000, Conrad Meyer wrote: >> Author: cem >> Date: Sat Mar 4 20:46:57 2017 >> New Revision: 314677 >> URL: https://svnweb.freebsd.org/changeset/base/314677 >> >> Log: >> fts: Fix a potential memory leak in error case >> >> Dan Krejsa reports a potential memory leak in an fts_build error case, >> detected by Coverity. (It doesn't seem to show up in Coverity Scan, so I >> don't have a CID to point to.) >> >> I don't know whether it is actually possible to arrive in this case with a >> non-empty 'head' list. The cost is low, though. One additional branch in a >> terminal error case isn't the end of the world. >> >> PR: 217125 >> Submitted by: Dan Krejsa >> >> Modified: >> head/lib/libc/gen/fts.c >> >> Modified: head/lib/libc/gen/fts.c >> ============================================================================== >> --- head/lib/libc/gen/fts.c Sat Mar 4 20:35:34 2017 (r314676) >> +++ head/lib/libc/gen/fts.c Sat Mar 4 20:46:57 2017 (r314677) >> @@ -850,6 +850,7 @@ mem1: saved_errno = errno; >> (cur->fts_level == FTS_ROOTLEVEL ? >> FCHDIR(sp, sp->fts_rfd) : >> fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) { >> + fts_lfree(head); >> cur->fts_info = FTS_ERR; >> SET(FTS_STOP); >> return (NULL); > > Shouldn't the same patch applied to fts-compat.c at line 872 ?