target/i386/sev: Plug memleak in sev_read_file_base64

Missing g_error_free() in sev_read_file_base64() error path.
Fix that.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <20200831134315.1221-5-pannengyuan@huawei.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
Pan Nengyuan 2020-08-31 09:43:09 -04:00 committed by Eduardo Habkost
parent 3aa8203e5e
commit efacd5b896

View File

@ -500,6 +500,7 @@ sev_read_file_base64(const char *filename, guchar **data, gsize *len)
if (!g_file_get_contents(filename, &base64, &sz, &error)) { if (!g_file_get_contents(filename, &base64, &sz, &error)) {
error_report("failed to read '%s' (%s)", filename, error->message); error_report("failed to read '%s' (%s)", filename, error->message);
g_error_free(error);
return -1; return -1;
} }