From de169ec977abe9e50ab1fc388fca26e408a8b99f Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 1 Jun 2004 12:55:33 +0000 Subject: [PATCH] 2004-06-01 Andrew Cagney * mi/mi-main.c (mi_cmd_data_read_memory): Add missing return for "invalid number of columns" error. Delete redundant "out of memory" check. --- gdb/ChangeLog | 6 ++++++ gdb/mi/mi-main.c | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7ad4f9764fb..f4931d7a3b9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-06-01 Andrew Cagney + + * mi/mi-main.c (mi_cmd_data_read_memory): Add missing return for + "invalid number of columns" error. Delete redundant "out of + memory" check. + 2004-05-31 Mark Kettenis * i386bsd-nat.c: Don't include . diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 6d738618d6e..02ed6284152 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -886,6 +886,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) { xasprintf (&mi_error_message, "mi_cmd_data_read_memory: invalid number of columns."); + return MI_CMD_ERROR; } /* The un-printable character when printing ascii. */ if (argc == 6) @@ -897,12 +898,6 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) total_bytes = word_size * nr_rows * nr_cols; mbuf = xcalloc (total_bytes, 1); make_cleanup (xfree, mbuf); - if (mbuf == NULL) - { - xasprintf (&mi_error_message, - "mi_cmd_data_read_memory: out of memory."); - return MI_CMD_ERROR; - } nr_bytes = 0; while (nr_bytes < total_bytes) { -- 2.30.2