diff options
Diffstat (limited to 'plugins/toshiba/toshiba-nvme.c')
-rw-r--r-- | plugins/toshiba/toshiba-nvme.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/toshiba/toshiba-nvme.c b/plugins/toshiba/toshiba-nvme.c index fd2e9c1..cf19352 100644 --- a/plugins/toshiba/toshiba-nvme.c +++ b/plugins/toshiba/toshiba-nvme.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later #include <fcntl.h> #include <errno.h> #include <stdio.h> @@ -148,6 +149,7 @@ static int nvme_sct_command_transfer_log(int fd, bool current) memcpy(data + 2, &function_code, sizeof(function_code)); err = nvme_sct_op(fd, OP_SCT_COMMAND_TRANSFER, DW10_SCT_COMMAND_TRANSFER, DW11_SCT_COMMAND_TRANSFER, data, data_len); + free(data); return err; } @@ -474,6 +476,7 @@ static int vendor_log(int argc, char **argv, struct command *cmd, struct plugin end: if (err > 0) nvme_show_status(err); + close(fd); return err; } @@ -517,6 +520,7 @@ static int internal_log(int argc, char **argv, struct command *cmd, struct plugi if (err > 0) nvme_show_status(err); + close(fd); return err; } @@ -569,5 +573,6 @@ static int clear_correctable_errors(int argc, char **argv, struct command *cmd, end: if (err > 0) nvme_show_status(err); + close(fd); return err; } |