mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +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
@ -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…
x
Reference in New Issue
Block a user