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
92838873
Unverified
Commit
92838873
authored
Jun 11, 2018
by
Donghwa Jeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: #1425801
Resource leak Signed-off-by:
Donghwa Jeong
<
dh48.jeong@samsung.com
>
parent
7177e6b1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
14 deletions
+0
-14
monitor.c
src/lxc/monitor.c
+0
-7
lxc_monitor.c
src/lxc/tools/lxc_monitor.c
+0
-7
No files found.
src/lxc/monitor.c
View file @
92838873
...
@@ -216,18 +216,11 @@ int lxc_monitor_open(const char *lxcpath)
...
@@ -216,18 +216,11 @@ int lxc_monitor_open(const char *lxcpath)
if
(
lxc_monitor_sock_name
(
lxcpath
,
&
addr
)
<
0
)
if
(
lxc_monitor_sock_name
(
lxcpath
,
&
addr
)
<
0
)
return
-
1
;
return
-
1
;
fd
=
socket
(
PF_UNIX
,
SOCK_STREAM
,
0
);
if
(
fd
<
0
)
{
ERROR
(
"Failed to create socket: %s."
,
strerror
(
errno
));
return
-
1
;
}
len
=
strlen
(
&
addr
.
sun_path
[
1
]);
len
=
strlen
(
&
addr
.
sun_path
[
1
]);
DEBUG
(
"opening monitor socket %s with len %zu"
,
&
addr
.
sun_path
[
1
],
len
);
DEBUG
(
"opening monitor socket %s with len %zu"
,
&
addr
.
sun_path
[
1
],
len
);
if
(
len
>=
sizeof
(
addr
.
sun_path
)
-
1
)
{
if
(
len
>=
sizeof
(
addr
.
sun_path
)
-
1
)
{
errno
=
ENAMETOOLONG
;
errno
=
ENAMETOOLONG
;
ERROR
(
"name of monitor socket too long (%zu bytes): %s"
,
len
,
strerror
(
errno
));
ERROR
(
"name of monitor socket too long (%zu bytes): %s"
,
len
,
strerror
(
errno
));
close
(
fd
);
return
-
1
;
return
-
1
;
}
}
...
...
src/lxc/tools/lxc_monitor.c
View file @
92838873
...
@@ -342,16 +342,9 @@ static int lxc_monitor_open(const char *lxcpath)
...
@@ -342,16 +342,9 @@ static int lxc_monitor_open(const char *lxcpath)
if
(
lxc_monitor_sock_name
(
lxcpath
,
&
addr
)
<
0
)
if
(
lxc_monitor_sock_name
(
lxcpath
,
&
addr
)
<
0
)
return
-
1
;
return
-
1
;
fd
=
socket
(
PF_UNIX
,
SOCK_STREAM
,
0
);
if
(
fd
<
0
)
{
fprintf
(
stderr
,
"Failed to create socket: %s
\n
"
,
strerror
(
errno
));
return
-
errno
;
}
len
=
strlen
(
&
addr
.
sun_path
[
1
]);
len
=
strlen
(
&
addr
.
sun_path
[
1
]);
if
(
len
>=
sizeof
(
addr
.
sun_path
)
-
1
)
{
if
(
len
>=
sizeof
(
addr
.
sun_path
)
-
1
)
{
errno
=
ENAMETOOLONG
;
errno
=
ENAMETOOLONG
;
close
(
fd
);
fprintf
(
stderr
,
"name of monitor socket too long (%zu bytes): %s
\n
"
,
len
,
strerror
(
errno
));
fprintf
(
stderr
,
"name of monitor socket too long (%zu bytes): %s
\n
"
,
len
,
strerror
(
errno
));
return
-
errno
;
return
-
errno
;
}
}
...
...
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