mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
irmap: duplicate string in irmap_scan_path_add
Duplicate string in irmap_scan_path_add, otherwise it will free before parsing next configuration input. [ avagin: handle errors of xstrdup ] Signed-off-by: Liu Hua <weldonliu@tencent.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
b169e3b63d
commit
daed6c3535
1 changed files with 6 additions and 1 deletions
|
|
@ -500,7 +500,12 @@ int irmap_scan_path_add(char *path)
|
|||
return -1;
|
||||
}
|
||||
|
||||
o->ir->path = path;
|
||||
o->ir->path = xstrdup(path);
|
||||
if (!o->ir->path) {
|
||||
xfree(o->ir);
|
||||
xfree(o);
|
||||
return -1;
|
||||
}
|
||||
o->ir->nr_kids = -1;
|
||||
list_add_tail(&o->node, &opts.irmap_scan_paths);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue