Check return value of qemu_mallocz in qemu_new_timer
PATCH 1/1 Check return value of qemu_mallocz in qemu_new_timer
Check return value of qemu_mallocz in qemu_new_timer
Signed-off-by vibi sreenivasan <[email protected]>
---
vl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
vl.c +0 -0
@@ -1119,6 +1119,8 @@ QEMUTimer *qemu_new_timer(QEMUClock *clock,
QEMUTimerCB *cb, void *opaque)
QEMUTimer *ts;
ts = qemu_mallocz(sizeof(QEMUTimer));
+ if (!ts)
+ return NULL;
ts->clock = clock;
ts->cb = cb;
ts->opaque = opaque;Quoted 13 lines · vibisreenivasan
Check return value of
qemu_malloczinqemu_new_timerSigned-off-by vibi sreenivasan <[email protected]>---
vl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)vl.c +0
-0
vl.c QEMUTimer *qemu_new_timer(QEMUClock *clock, · line 1120
Quoted 2 lines
vl.c +0
-0@@ -1119,6 +1119,8 @@ QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque)
Your mailer munged this patch.
Regards,
Anthony Liguori
Quoted 9 lines
vl.c +2
-0QEMUTimer *ts; ts =qemu_mallocz (sizeof (QEMUTimer)); +if (!ts) +return NULL ; ts->clock = clock;ts->cb = cb; ts->opaque = opaque;