[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/12] target/i386/sev: Plug memleak in sev_read_file_base64
From: |
Pan Nengyuan |
Subject: |
[PATCH 05/12] target/i386/sev: Plug memleak in sev_read_file_base64 |
Date: |
Fri, 14 Aug 2020 12:02:34 -0400 |
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>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
---
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;
}
--
2.18.2