Handle converting vectors of strings to argv safely
When exec'ing a new binary, one needs to get the command line
args into a char* const*, but we generally use standard C++
types when actually working with data. The old code was leaking
the copy of these data that it created to pass into execv(),
but the new code uses C++ types more so that memory is auto-managed,
and then just makes a C-friendly representation right before
calling execv.
BUG=chromium:378834
TEST=unit
TEST=login_LoginSuccess, login_OwnershipTaken
Change-Id: Iaa6cd0bf8224fbcb0a6f9218f37de5bbf166cc60
Reviewed-on: https://chromium-review.googlesource.com/202130
Commit-Queue: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
6 files changed