]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: fix json object memory leak
authorMax Gurtovoy <maxg@mellanox.com>
Thu, 30 May 2019 09:43:25 +0000 (12:43 +0300)
committerKeith Busch <keith.busch@gmail.com>
Fri, 7 Jun 2019 16:16:53 +0000 (10:16 -0600)
Reviewed-by: Minwoo Im <minwoo.im@samsung.com>
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
nvme-print.c

index 2c4822e7febdb700148e4d869ad68fd297df0a86..6f85e73a8a73c35a80e2448a27386b8bbc15fca4 100644 (file)
@@ -2918,6 +2918,7 @@ void json_print_nvme_subsystem_list(struct subsys_list_item *slist, int n)
                json_object_add_value_array(root, "Subsystems", subsystems);
        json_print_object(root, NULL);
        printf("\n");
+       json_free_object(root);
 }
 
 static void show_registers_cap(struct nvme_bar_cap *cap)