Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 3160499aacb81f6735941eb4c372d87a > files > 654

kvm-83-164.el5_5.30.src.rpm

From e2c4d6ad3f123b365e89089b319342c1858686d0 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Mon, 18 May 2009 18:22:10 -0300
Subject: [PATCH 07/14] vnc: Remove checks for qemu_realloc() return value

Sometimes we pass 0 to qemu_realloc(), and qemu_realloc() can (correctly)
return NULL on those cases.

Also, qemu_malloc() and qemu_realloc() are going to abort the qemu process
if allocation fails, so we don't need those checks in place anyway.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Depends: <20090515171218.GC2079@blackpad>
Depends: <20090518170152.GL2079@blackpad>
Message-ID: <20090518212210.GN2079@blackpad>
RH-Upstream-status: not-applicable
Acked-by: john cooper <john.cooper@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Luiz Capitulino <lcapitul@redhat.com>
Bugzilla: 503793
---
 qemu/vnc.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/qemu/vnc.c b/qemu/vnc.c
index 31413f1..8f1fe28 100644
--- a/qemu/vnc.c
+++ b/qemu/vnc.c
@@ -319,11 +319,6 @@ static void vnc_resize(VncState *vs, int w, int h)
 {
     vs->old_data = qemu_realloc(vs->old_data, w * h * vs->depth);
 
-    if (vs->old_data == NULL) {
-	fprintf(stderr, "vnc: memory allocation failed\n");
-	exit(1);
-    }
-
     if (vs->width != w || vs->height != h) {
         VNC_DEBUG("%s/%d: %dx%d\n", __FUNCTION__, vs->csock, w, h);
         vs->width = w;
@@ -351,10 +346,6 @@ static void vnc_dpy_resize(DisplayState *ds, int w, int h)
     ds->height = h;
     ds->linesize = w * ds->depth/8;
     ds->data = qemu_realloc(ds->data, ds->linesize * ds->height);
-    if (ds->data == NULL) {
-	fprintf(stderr, "vnc: memory allocation failed\n");
-	exit(1);
-    }
 
     while (vs != NULL) {
         vnc_resize(vs, w, h);
-- 
1.6.3.rc4.29.g8146