Skip to content

Commit

Permalink
hmp: free sev info
Browse files Browse the repository at this point in the history
Found thanks to ASAN:

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7efe20417a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
    #1 0x7efe1f7b2f75 in g_malloc0 ../glib/gmem.c:124
    #2 0x7efe1f7b3249 in g_malloc0_n ../glib/gmem.c:355
    #3 0x558272879162 in sev_get_info /home/elmarco/src/qemu/target/i386/sev.c:414
    #4 0x55827285113b in hmp_info_sev /home/elmarco/src/qemu/target/i386/monitor.c:684
    #5 0x5582724043b8 in handle_hmp_command /home/elmarco/src/qemu/monitor.c:3333

Fixes: 6303631
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180319175823.22111-1-marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  • Loading branch information
elmarco authored and dagrh committed Mar 20, 2018
1 parent 32cd655 commit 9537218
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions target/i386/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,8 @@ void hmp_info_sev(Monitor *mon, const QDict *qdict)
} else {
monitor_printf(mon, "SEV is not enabled\n");
}

qapi_free_SevInfo(info);
}

SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp)
Expand Down

0 comments on commit 9537218

Please sign in to comment.