mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 14:33:38 +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
154fe59531
commit
067cf8aa2c
@ -1199,6 +1199,7 @@ int create_and_inject_vrtct(struct vmctx *ctx)
|
|||||||
rc = read(native_rtct_fd, buf, native_rtct_len);
|
rc = read(native_rtct_fd, buf, native_rtct_len);
|
||||||
if (rc < native_rtct_len) {
|
if (rc < native_rtct_len) {
|
||||||
pr_err("Native RTCT is not fully read into buf!!!");
|
pr_err("Native RTCT is not fully read into buf!!!");
|
||||||
|
free(buf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
close(native_rtct_fd);
|
close(native_rtct_fd);
|
||||||
|
Loading…
Reference in New Issue
Block a user