diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index c3848b5246..0909b4da3d 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -507,7 +507,11 @@ static int qemuMonitorParseExtraBalloonInfo(char *text, ",total_mem=", &stats[nr_stats_found])) nr_stats_found++; - /* Skip to the next label */ + /* Skip to the next label. When *p is ',' the last match attempt + * failed so try to match the next ','. + */ + if (*p == ',') + p++; p = strchr (p, ','); if (!p) break; }