mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
page-xfer: add proper initialization and deletion of xfer->parent
Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
2824c968e7
commit
e18ae2a8f5
1 changed files with 7 additions and 0 deletions
|
|
@ -557,6 +557,11 @@ static int write_pagehole_loc(struct page_xfer *xfer, struct iovec *iov)
|
|||
|
||||
static void close_page_xfer(struct page_xfer *xfer)
|
||||
{
|
||||
if (xfer->parent != NULL) {
|
||||
xfer->parent->close(xfer->parent);
|
||||
xfree(xfer->parent);
|
||||
xfer->parent = NULL;
|
||||
}
|
||||
close(xfer->fd_pg);
|
||||
close(xfer->fd);
|
||||
}
|
||||
|
|
@ -640,6 +645,8 @@ static int open_page_local_xfer(struct page_xfer *xfer, int fd_type, long id)
|
|||
int ret;
|
||||
int pfd;
|
||||
|
||||
xfer->parent = NULL;
|
||||
|
||||
pfd = openat(get_service_fd(IMG_FD_OFF), CR_PARENT_LINK, O_RDONLY);
|
||||
if (pfd < 0 && errno == ENOENT)
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue