From c88a87c59876e206b33c612b9e852b8e3f3be403 Mon Sep 17 00:00:00 2001 From: Kenneth Heitke Date: Wed, 3 Apr 2019 17:45:43 -0600 Subject: [PATCH] Fix possible memory leak on get-internal-log --- plugins/intel/intel-nvme.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/intel/intel-nvme.c b/plugins/intel/intel-nvme.c index 7fefdb4c..7009d4f4 100644 --- a/plugins/intel/intel-nvme.c +++ b/plugins/intel/intel-nvme.c @@ -688,8 +688,11 @@ static int get_internal_log(int argc, char **argv, struct command *command, stru }; fd = parse_and_open(argc, argv, desc, command_line_options, &cfg, sizeof(cfg)); - if (fd < 0) + if (fd < 0) { + free(intel); return fd; + } + if (cfg.log > 2 || cfg.core > 4 || cfg.lnum > 255) { free(intel); return EINVAL; -- 2.50.1