diff options
author | Pan Nengyuan <pannengyuan@huawei.com> | 2020-08-31 09:43:09 -0400 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-02 07:30:26 -0400 |
commit | efacd5b89643ea98c9377630f9054de8b380008b (patch) | |
tree | fd95f2af247759ac36fd69103453bcc16cabdee6 /target/i386/sev.c | |
parent | 3aa8203e5ef460f9e22ca1dd78f2013fa9610276 (diff) |
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>
Diffstat (limited to 'target/i386/sev.c')
-rw-r--r-- | target/i386/sev.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |