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; }