diff options
author | Michael Snyder <msnyder@vmware.com> | 2007-06-28 21:48:54 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2007-06-28 21:48:54 +0000 |
commit | dd3526aae6ef530f6a5356fbe36819c9195fe416 (patch) | |
tree | 5624c87240fe5b2cb96bf5dab1151edaa489d3d8 /gdb/cli | |
parent | a5b3b4ddf1797fa1009715d21de03b9ff08c1f92 (diff) | |
download | gdb-dd3526aae6ef530f6a5356fbe36819c9195fe416.zip gdb-dd3526aae6ef530f6a5356fbe36819c9195fe416.tar.gz gdb-dd3526aae6ef530f6a5356fbe36819c9195fe416.tar.bz2 |
2007-06-28 Michael Snyder <msnyder@access-company.com>
* cli/cli-script.c (build_command_line): Add null pointer guard
(Coverity).
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-script.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index ad64a4a..2dff85e 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -95,7 +95,9 @@ build_command_line (enum command_control_type type, char *args) = (struct command_line **) xmalloc (sizeof (struct command_line *) * cmd->body_count); memset (cmd->body_list, 0, sizeof (struct command_line *) * cmd->body_count); - cmd->line = savestring (args, strlen (args)); + if (args != NULL) + cmd->line = savestring (args, strlen (args)); + return cmd; } |