]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fix pointer c is dereferenced after checking null
authorDonghwa Jeong <dh48.jeong@samsung.com>
Tue, 19 Jun 2018 01:37:47 +0000 (10:37 +0900)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 10 Dec 2018 13:29:00 +0000 (14:29 +0100)
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
src/tests/get_item.c

index f009344d27669ac94e2f2cf2184b4041de418e73..4a67246c43a7f86e2a0b76dba583bfdb11fe12d6 100644 (file)
@@ -321,7 +321,10 @@ int main(int argc, char *argv[])
        printf("All get_item tests passed\n");
        ret = EXIT_SUCCESS;
 out:
-       c->destroy(c);
-       lxc_container_put(c);
+       if (c) {
+               c->destroy(c);
+               lxc_container_put(c);
+       }
+
        exit(ret);
 }