diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zpool/zpool_main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index edcfe2db7..6a54c92c3 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -4131,8 +4131,11 @@ print_zpool_script_help(char *name, char *path) rc = libzfs_run_process_get_stdout_nopath(path, argv, NULL, &lines, &lines_cnt); - if (rc != 0 || lines == NULL || lines_cnt <= 0) + if (rc != 0 || lines == NULL || lines_cnt <= 0) { + if (lines != NULL) + libzfs_free_str_array(lines, lines_cnt); return; + } for (int i = 0; i < lines_cnt; i++) if (!is_blank_str(lines[i])) |