From efacd5b89643ea98c9377630f9054de8b380008b Mon Sep 17 00:00:00 2001 From: Pan Nengyuan Date: Mon, 31 Aug 2020 09:43:09 -0400 Subject: [PATCH] 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 Signed-off-by: Pan Nengyuan Reviewed-by: Li Qiang Message-Id: <20200831134315.1221-5-pannengyuan@huawei.com> Signed-off-by: Eduardo Habkost --- target/i386/sev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/sev.c b/target/i386/sev.c index c3ecf86704..de4818da6d 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -500,6 +500,7 @@ sev_read_file_base64(const char *filename, guchar **data, gsize *len) if (!g_file_get_contents(filename, &base64, &sz, &error)) { error_report("failed to read '%s' (%s)", filename, error->message); + g_error_free(error); return -1; }