Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
a8b7a905
Unverified
Commit
a8b7a905
authored
Dec 09, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: #1425858
free allocated memory Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
46e40f82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
criu.c
src/lxc/criu.c
+12
-5
No files found.
src/lxc/criu.c
View file @
a8b7a905
...
@@ -1120,14 +1120,16 @@ static int save_tty_major_minor(char *directory, struct lxc_container *c, char *
...
@@ -1120,14 +1120,16 @@ static int save_tty_major_minor(char *directory, struct lxc_container *c, char *
/* do one of either predump or a regular dump */
/* do one of either predump or a regular dump */
static
bool
do_dump
(
struct
lxc_container
*
c
,
char
*
mode
,
struct
migrate_opts
*
opts
)
static
bool
do_dump
(
struct
lxc_container
*
c
,
char
*
mode
,
struct
migrate_opts
*
opts
)
{
{
int
ret
;
pid_t
pid
;
pid_t
pid
;
char
*
criu_version
=
NULL
;
int
criuout
[
2
];
int
criuout
[
2
];
char
*
criu_version
=
NULL
;
if
(
!
criu_ok
(
c
,
&
criu_version
))
if
(
!
criu_ok
(
c
,
&
criu_version
))
return
false
;
return
false
;
if
(
pipe
(
criuout
)
<
0
)
{
ret
=
pipe
(
criuout
);
if
(
ret
<
0
)
{
SYSERROR
(
"pipe() failed"
);
SYSERROR
(
"pipe() failed"
);
return
false
;
return
false
;
}
}
...
@@ -1162,12 +1164,16 @@ static bool do_dump(struct lxc_container *c, char *mode, struct migrate_opts *op
...
@@ -1162,12 +1164,16 @@ static bool do_dump(struct lxc_container *c, char *mode, struct migrate_opts *op
os
.
console_name
=
c
->
lxc_conf
->
console
.
path
;
os
.
console_name
=
c
->
lxc_conf
->
console
.
path
;
os
.
criu_version
=
criu_version
;
os
.
criu_version
=
criu_version
;
if
(
save_tty_major_minor
(
opts
->
directory
,
c
,
os
.
tty_id
,
sizeof
(
os
.
tty_id
))
<
0
)
ret
=
save_tty_major_minor
(
opts
->
directory
,
c
,
os
.
tty_id
,
sizeof
(
os
.
tty_id
));
exit
(
1
);
if
(
ret
<
0
)
{
free
(
criu_version
);
exit
(
EXIT_FAILURE
);
}
/* exec_criu() returning is an error */
/* exec_criu() returning is an error */
exec_criu
(
&
os
);
exec_criu
(
&
os
);
exit
(
1
);
free
(
criu_version
);
exit
(
EXIT_FAILURE
);
}
else
{
}
else
{
int
status
;
int
status
;
ssize_t
n
;
ssize_t
n
;
...
@@ -1214,6 +1220,7 @@ fail:
...
@@ -1214,6 +1220,7 @@ fail:
close
(
criuout
[
0
]);
close
(
criuout
[
0
]);
close
(
criuout
[
1
]);
close
(
criuout
[
1
]);
rmdir
(
opts
->
directory
);
rmdir
(
opts
->
directory
);
free
(
criu_version
);
return
false
;
return
false
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment