From: Keith Busch Date: Thu, 25 May 2017 12:01:13 +0000 (-0600) Subject: nvme-print: Free only top-level json objects X-Git-Tag: v1.4~52^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ac78cef4d3cf3b03afee6d4eb5ed5955385ae606;p=users%2Fsagi%2Fnvme-cli.git nvme-print: Free only top-level json objects 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 --- diff --git a/nvme-print.c b/nvme-print.c index 60fe1198..184dd739 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -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); }