summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Support/FoldingSet.cpp
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2012-12-01 17:44:06 +0000
committermarcel <marcel@FreeBSD.org>2012-12-01 17:44:06 +0000
commit5192abbac636f4d423299ad2010b603072124621 (patch)
treea70dd50cb9d7f92c16e3c604fece1c9e8c7f8fbe /contrib/llvm/lib/Support/FoldingSet.cpp
parent242dabb510e96151dfa1c14d7e2ffd1db8fc882a (diff)
downloadFreeBSD-src-5192abbac636f4d423299ad2010b603072124621.zip
FreeBSD-src-5192abbac636f4d423299ad2010b603072124621.tar.gz
In globextend() when the pathv vector cannot be (re-)allocated, don't
free and clear the gl_pathv pointer in the glob_t structure. Such breaks the invariant of the glob_t structure, as stated in the comment right in front of the globextend() function. If gl_pathv was non-NULL, then gl_pathc was > 0. Making gl_pathv a NULL pointer without also setting gl_pathc to 0 is wrong. Since we otherwise don't free the memory associated with a glob_t in error cases, it's unlikely that this change will cause a memory leak that wasn't already there to begin with. Callers of glob(3) must call globfree(3) irrespective of whether glob(3) returned an error or not.
Diffstat (limited to 'contrib/llvm/lib/Support/FoldingSet.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud