summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Leech <cleech@redhat.com>2019-10-30 13:54:27 -0700
committerChris Leech <cleech@redhat.com>2019-10-31 15:48:08 -0700
commit096fc3ca10492c0810f1aaf76266006a2a803109 (patch)
treebe6b7ca62561e5dd7c1dd1a329d81dc179327798
parent020d46c3cb95d627bd1246e6212981cf22adf651 (diff)
downloadopen-iscsi-096fc3ca10492c0810f1aaf76266006a2a803109.tar.gz
Resource leak: Variable matched_ses going out of scope leaks the storage it points to.
-rw-r--r--usr/host.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/host.c b/usr/host.c
index 356650c..c94b6d1 100644
--- a/usr/host.c
+++ b/usr/host.c
@@ -262,14 +262,14 @@ static int host_info_print_tree(void *data, struct host_info *hinfo)
matched_ses[matched_se_count++] = ses[i];
if (!matched_se_count)
- return 0;
+ goto out;
printf("\t*********\n");
printf("\tSessions:\n");
printf("\t*********\n");
session_info_print_tree(matched_ses, matched_se_count, "\t",
session_info_flags, 0/* don't show password */);
-
+out:
free(matched_ses);
return 0;
}