]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: Free only top-level json objects
authorKeith Busch <keith.busch@intel.com>
Thu, 25 May 2017 12:01:13 +0000 (06:01 -0600)
committerKeith Busch <keith.busch@intel.com>
Thu, 25 May 2017 12:03:26 +0000 (06:03 -0600)
We only need to free the root json object as it already frees everything
below it. This patch fixes a double free that results in a segfault.

https://github.com/linux-nvme/nvme-cli/issues/182

Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme-print.c

index 60fe1198dcf38cfa9d54e624368cf1fb22436b3f..184dd739eabe5c44c1a71c1a0de17fdec923fc3c 100644 (file)
@@ -1408,7 +1408,6 @@ void json_fw_log(struct nvme_firmware_log_page *fw_log, const char *devname)
 
        json_print_object(root, NULL);
        printf("\n");
-       json_free_object(fwsi);
        json_free_object(root);
 }