Commit 9f8a7cca authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

restore: sigreturn_restore: free core _after_ using it

Currently we have this:
	.......
	/* No longer need it */
	core_entry__free_unpacked(core, NULL);

	ret = prepare_itimers(pid, core, task_args);
	if (ret < 0)
		goto err;
	.......

So we're using ptr right after free-ing it.
Signed-off-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 787e8a1d
...@@ -2645,9 +2645,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core) ...@@ -2645,9 +2645,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
new_sp = restorer_stack(task_args->t); new_sp = restorer_stack(task_args->t);
/* No longer need it */
core_entry__free_unpacked(core, NULL);
ret = prepare_itimers(pid, core, task_args); ret = prepare_itimers(pid, core, task_args);
if (ret < 0) if (ret < 0)
goto err; goto err;
...@@ -2660,6 +2657,9 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core) ...@@ -2660,6 +2657,9 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
if (ret < 0) if (ret < 0)
goto err; goto err;
/* No longer need it */
core_entry__free_unpacked(core, NULL);
/* /*
* Open the last_pid syscl early, since restorer (maybe) lives * Open the last_pid syscl early, since restorer (maybe) lives
* in chroot and has no access to "/proc/..." paths. * in chroot and has no access to "/proc/..." paths.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment