diff --git a/cr-restore.c b/cr-restore.c index e851cb67e..4d13bd9c9 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -2014,14 +2014,14 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core) pr_info("Restore via sigreturn\n"); - if (rst_mem_init()) - goto err; - ret = parse_smaps(pid, &self_vmas, false); close_proc(); if (ret < 0) goto err; + if (rst_mem_init()) + goto err; + self_vmas_len = round_up((self_vmas.nr + 1) * sizeof(VmaEntry), PAGE_SIZE); vmas_len = round_up((rst_vmas.nr + 1) * sizeof(VmaEntry), PAGE_SIZE);