diff options
author | zhangjixiang <jixiang_zhang@h3c.com> | 2018-02-25 09:47:51 +0800 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2018-03-20 12:32:06 +0000 |
commit | 32cd6550f7a6c8a621798c8b249eae2597db04ea (patch) | |
tree | 9ac58a368b3304e80675ca86169f4a77a6266591 | |
parent | 4bdc24fa018901892bb8a5bd1808ebd605f4c64d (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>
-rw-r--r-- | hmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) { |