mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 11:13:50 +00:00
cgfsng: fix memory leak in lxc_cpumask_to_cpulist
Signed-off-by: LiFeng <lifeng68@huawei.com>
This commit is contained in:
parent
daf6a727aa
commit
24cac6aff1
@ -320,6 +320,7 @@ static char *lxc_cpumask_to_cpulist(uint32_t *bitarr, size_t nbits)
|
||||
{
|
||||
int ret;
|
||||
size_t i;
|
||||
char *tmp = NULL;
|
||||
char **cpulist = NULL;
|
||||
char numstr[INTTYPE_TO_STRLEN(size_t)] = {0};
|
||||
|
||||
@ -343,7 +344,10 @@ static char *lxc_cpumask_to_cpulist(uint32_t *bitarr, size_t nbits)
|
||||
if (!cpulist)
|
||||
return NULL;
|
||||
|
||||
return lxc_string_join(",", (const char **)cpulist, false);
|
||||
tmp = lxc_string_join(",", (const char **)cpulist, false);
|
||||
lxc_free_array((void **)cpulist, free);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static ssize_t get_max_cpus(char *cpulist)
|
||||
|
Loading…
Reference in New Issue
Block a user