From 00ffa5c9308826914727d211137dc961c9cff2d4 Mon Sep 17 00:00:00 2001 From: Chen Huitao Date: Tue, 14 Jan 2020 09:05:34 -0500 Subject: [PATCH] Remove warnings (#1140) * remove warnings on windows with vs2019. * remove warnings. Backports commit ca6516ff790f2c6b2bc59a6b7472cb25be0f82b8 from unicorn. --- qemu/glib_compat.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qemu/glib_compat.c b/qemu/glib_compat.c index b32376c4..2f465182 100644 --- a/qemu/glib_compat.c +++ b/qemu/glib_compat.c @@ -1265,7 +1265,7 @@ static inline guint g_hash_table_lookup_node_for_insertion (GHashTable *hash_ GHashNode *node; guint node_index; guint hash_value; - guint first_tombstone; + guint first_tombstone = 0; gboolean have_tombstone = FALSE; guint step = 0; @@ -2126,7 +2126,10 @@ char *g_strdup_vprintf(const char *format, va_list ap) return NULL; vsnprintf(str_res, len+1, format, ap); #else - vasprintf(&str_res, format, ap); + int ret = vasprintf(&str_res, format, ap); + if (ret == -1) { + return NULL; + } #endif return str_res; }