]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fts: Fix a potential memory leak in error case
authorConrad Meyer <cem@FreeBSD.org>
Sat, 4 Mar 2017 20:46:57 +0000 (20:46 +0000)
committerConrad Meyer <cem@FreeBSD.org>
Sat, 4 Mar 2017 20:46:57 +0000 (20:46 +0000)
commit8844cec8f31b58fcd22cb4021615165ced2ea5c4
treeaf07101b64ce7dbc4233621841c95d6ac379193d
parent81a687a7ff23462db5b1cd93d1a950050b3564a7
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>
lib/libc/gen/fts.c