aboutsummaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
authorzhangjixiang <jixiang_zhang@h3c.com>2018-02-25 09:47:51 +0800
committerDr. David Alan Gilbert <dgilbert@redhat.com>2018-03-20 12:32:06 +0000
commit32cd6550f7a6c8a621798c8b249eae2597db04ea (patch)
tree9ac58a368b3304e80675ca86169f4a77a6266591 /hmp.c
parent4bdc24fa018901892bb8a5bd1808ebd605f4c64d (diff)
HMP: Initialize err before using
When bdrv_snapshot_delete return fail, the errp will not be assigned a valid value in error_propagate as errp didn't be initialized in hmp_delvm, then error_reportf_err will use an uninitialized value(call by hmp_delvm), and qemu crash. Signed-off-by: zhangjixiang <jixiang_zhang@h3c.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r--hmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hmp.c b/hmp.c
index ba9e299ee2..fd13d5b56a 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1321,7 +1321,7 @@ void hmp_savevm(Monitor *mon, const QDict *qdict)
void hmp_delvm(Monitor *mon, const QDict *qdict)
{
BlockDriverState *bs;
- Error *err;
+ Error *err = NULL;
const char *name = qdict_get_str(qdict, "name");
if (bdrv_all_delete_snapshot(name, &bs, &err) < 0) {