Don't leak when expanding response files.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 24 Jul 2013 14:32:01 +0000 (14:32 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 24 Jul 2013 14:32:01 +0000 (14:32 +0000)
commit1e3c0a4c77611f99f1e482de256c59358a902b63
treedb3335a1a38a49ad1de98289c5c8de401fe3cd70
parent797684279172bd56d08d4cefb76b1a9f9a4aabe6
Don't leak when expanding response files.

Before this patch we would strdup each argument. If one was a response file,
we would replace it with the response file contents, leaking the original
strdup result.

We now don't strdup the originals and let StringSaver free any memory it
allocated. This also saves a bit of malloc traffic when response files are
not used.

Leak found by the valgrind build bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187042 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/CommandLine.cpp