mirror of
git://github.com/lxc/lxc
synced 2025-09-02 09:59:34 +00:00
tests: containertests: fix dereference pointer c
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
This commit is contained in:
@@ -149,8 +149,15 @@ int main(int argc, char *argv[])
|
|||||||
goto out;
|
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__);
|
fprintf(stderr, "%d: c was freed on non-final put\n", __LINE__);
|
||||||
|
c = NULL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,8 +264,8 @@ out:
|
|||||||
if (c) {
|
if (c) {
|
||||||
c->stop(c);
|
c->stop(c);
|
||||||
destroy_busybox();
|
destroy_busybox();
|
||||||
|
lxc_container_put(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
lxc_container_put(c);
|
|
||||||
exit(ret);
|
exit(ret);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user