Patchwork [01/10] ui/spice-display.c: add missing initialization for valgrind

login
register
mail settings
Submitter Gerd Hoffmann
Date June 12, 2012, 7:51 a.m.
Message ID <1339487474-8481-2-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/164338/
State New
Headers show

Comments

Gerd Hoffmann - June 12, 2012, 7:51 a.m.
From: Alon Levy <alevy@redhat.com>

We can't initialize QXLDevSurfaceCreate field by field because it has a
pa hole, and so 4 bytes remain uninitialized when building on x86-64, so
just memset.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-display.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/ui/spice-display.c b/ui/spice-display.c
index 5418eb3..3e8f0b3 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -244,6 +244,8 @@  void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd)
 {
     QXLDevSurfaceCreate surface;
 
+    memset(&surface, 0, sizeof(surface));
+
     dprint(1, "%s: %dx%d\n", __FUNCTION__,
            ds_get_width(ssd->ds), ds_get_height(ssd->ds));