mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 22:42:53 +00:00
dm: fix memory leakage issue in disk_logger.c
In function probe_disk_log_file(), handler 'dir' returned by opendir() is not released before function return and results in memory leakage. Tracked-On: #7098 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
4b0590415d
commit
13ce55ef4f
@ -96,6 +96,7 @@ static int probe_disk_log_file(void)
|
|||||||
index = tmp;
|
index = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
closedir(dir);
|
||||||
|
|
||||||
snprintf(file_name, FILE_NAME_LENGTH - 1, LOG_NAME_FMT, LOG_PATH_NODE, vmname, index);
|
snprintf(file_name, FILE_NAME_LENGTH - 1, LOG_NAME_FMT, LOG_PATH_NODE, vmname, index);
|
||||||
disk_fd = open(file_name, O_RDWR | O_CREAT | O_APPEND, 0644);
|
disk_fd = open(file_name, O_RDWR | O_CREAT | O_APPEND, 0644);
|
||||||
|
Loading…
Reference in New Issue
Block a user