Skip to contentSkip to conversation

readline: Remove unneeded qemu_mallocz() check

PATCH In review Luiz Capitulino 2 participants 2 messages Jun 15, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 readline: Remove unneeded qemu_mallocz() check

qemu_mallocz() already checks for NULL returns, readline_init() doesn't have to do it again.

---
 readline.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
readline.c +0 -3
index 9c500f1..7834af0 100644
@@ -467,9 +467,6 @@ ReadLineState *readline_init(Monitor *mon,
 {
     ReadLineState *rs = qemu_mallocz(sizeof(*rs));
 
-    if (!rs)
-        return NULL;
-
     rs->hist_entry = -1;
     rs->mon = mon;
     rs->completion_finder = completion_finder;
Signature · 1 line
1.6.3.GIT
#1 lore raw
Quoted 13 lines · Luiz Capitulino

qemu_mallocz() already checks for NULL returns, readline_init() doesn't have to do it again.

---
 readline.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
readline.c +0 -0
index 9c500f1..7834af0 100644

readline.c ReadLineState *readline_init(Monitor *mon, · line 472

Quoted 9 lines
readline.c +0 -3
@@ -467,9 +467,6 @@ ReadLineState *readline_init(Monitor *mon,
 {
     ReadLineState *rs = qemu_mallocz(sizeof(*rs));
 
-    if (!rs)
-        return NULL;
-
     rs->hist_entry = -1;
     rs->mon = mon;
     rs->completion_finder = completion_finder;

Ack.

Jan