Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2017 08:49:36 -0800
From:      Conrad Meyer <cem@freebsd.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r314677 - head/lib/libc/gen
Message-ID:  <CAG6CVpUWTxUcR1j14=BGLsYZK1MefU6WRo3kivvUOwEN_WtR5Q@mail.gmail.com>
In-Reply-To: <20170307153227.GN30979@kib.kiev.ua>
References:  <201703042046.v24KkvTw062504@repo.freebsd.org> <20170307153227.GN30979@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Yes.

On Tue, Mar 7, 2017 at 7:32 AM, Konstantin Belousov <kostikbel@gmail.com> 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 <dan.krejsa at gmail.com>
>>
>> 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 ?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpUWTxUcR1j14=BGLsYZK1MefU6WRo3kivvUOwEN_WtR5Q>