This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH v2 02/31] cli/cli-script.c: Remove some dead NULL checks
On 2016-10-18 21:11, Pedro Alves wrote:
@@ -853,8 +845,6 @@ insert_args (char *line)
/* Allocate space for the new line and fill it in. */
new_line = (char *) xmalloc (len + 1);
- if (new_line == NULL)
- return NULL;
/* Restore pointer to beginning of old line. */
line = save_line;
A few lines higher in insert_args, there is:
error (_("Missing argument %d in user function."), i);
That return NULL is also dead code and could be confusing, leading
someone to think insert_args can return NULL. I think you could remove
it at the same time.