mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-05 01:42:33 +00:00
tests: containertests: fix dereference pointer c
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
This commit is contained in:
parent
b988d228d1
commit
12a1a87296
@ -149,8 +149,15 @@ int main(int argc, char *argv[])
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (lxc_container_put(c) != 0) {
|
||||
ret = lxc_container_put(c);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "%d: c is invalid pointer\n", __LINE__);
|
||||
ret = 1;
|
||||
goto out;
|
||||
}
|
||||
else if (ret == 1) {
|
||||
fprintf(stderr, "%d: c was freed on non-final put\n", __LINE__);
|
||||
c = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -257,8 +264,8 @@ out:
|
||||
if (c) {
|
||||
c->stop(c);
|
||||
destroy_busybox();
|
||||
lxc_container_put(c);
|
||||
}
|
||||
|
||||
lxc_container_put(c);
|
||||
exit(ret);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user