mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 23:13:26 +00:00
dm: fix memory leakage risk in create_and_inject_vrtct
Reading native RTCT failure induces leakage of memory pointered by 'buf'. Tracked-On: #6157 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
cb59ac1cfe
commit
59635fb984
@ -1198,6 +1198,7 @@ int create_and_inject_vrtct(struct vmctx *ctx)
|
||||
rc = read(native_rtct_fd, buf, native_rtct_len);
|
||||
if (rc < native_rtct_len) {
|
||||
pr_err("Native RTCT is not fully read into buf!!!");
|
||||
free(buf);
|
||||
return -1;
|
||||
}
|
||||
close(native_rtct_fd);
|
||||
|
Loading…
Reference in New Issue
Block a user