aboutsummaryrefslogtreecommitdiff
path: root/libcc1
diff options
context:
space:
mode:
Diffstat (limited to 'libcc1')
-rw-r--r--libcc1/gdbctx.hh8
1 files changed, 2 insertions, 6 deletions
diff --git a/libcc1/gdbctx.hh b/libcc1/gdbctx.hh
index 4a48381..4d24883 100644
--- a/libcc1/gdbctx.hh
+++ b/libcc1/gdbctx.hh
@@ -308,15 +308,11 @@ namespace cc1_plugin
self->add_callbacks ();
- char **argv = new (std::nothrow) char *[self->args.size () + 1];
- if (argv == NULL)
- return 0;
-
+ std::vector<char *> argv (self->args.size () + 1);
for (unsigned int i = 0; i < self->args.size (); ++i)
argv[i] = const_cast<char *> (self->args[i].c_str ());
- argv[self->args.size ()] = NULL;
- return self->fork_exec (argv, fds, stderr_fds);
+ return self->fork_exec (argv.data (), fds, stderr_fds);
}
static int