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
3c981fcb
Unverified
Commit
3c981fcb
authored
Feb 03, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: check for NULL in device_add_remove
Fixes: Coverity 1472768 Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
07f89a4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
device_add_remove.c
src/tests/device_add_remove.c
+3
-2
No files found.
src/tests/device_add_remove.c
View file @
3c981fcb
...
@@ -36,8 +36,8 @@ int main(int argc, char *argv[])
...
@@ -36,8 +36,8 @@ int main(int argc, char *argv[])
__do_close
int
fd_log
=
-
EBADF
;
__do_close
int
fd_log
=
-
EBADF
;
int
ret
=
1
;
int
ret
=
1
;
struct
lxc_log
log
=
{};
struct
lxc_log
log
=
{};
struct
lxc_container
*
c
=
NULL
;
char
template
[
sizeof
(
P_tmpdir
"/attach_XXXXXX"
)];
char
template
[
sizeof
(
P_tmpdir
"/attach_XXXXXX"
)];
struct
lxc_container
*
c
;
(
void
)
strlcpy
(
template
,
P_tmpdir
"/attach_XXXXXX"
,
sizeof
(
template
));
(
void
)
strlcpy
(
template
,
P_tmpdir
"/attach_XXXXXX"
,
sizeof
(
template
));
...
@@ -107,6 +107,7 @@ out:
...
@@ -107,6 +107,7 @@ out:
}
}
(
void
)
unlink
(
template
);
(
void
)
unlink
(
template
);
lxc_container_put
(
c
);
if
(
c
)
lxc_container_put
(
c
);
return
ret
;
return
ret
;
}
}
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