From a14df3994219436dd54ab9592cfbb769d799086e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 17 Jun 2015 00:27:18 +0000 Subject: [PATCH] iscsiadm: Do not allocate more memory than needed Detected by Coverity. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6378 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/usr/iscsi_adm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscsi-scst/usr/iscsi_adm.c b/iscsi-scst/usr/iscsi_adm.c index c50f45923..c29aa5f79 100644 --- a/iscsi-scst/usr/iscsi_adm.c +++ b/iscsi-scst/usr/iscsi_adm.c @@ -488,7 +488,7 @@ static int user_handle_show_list(struct iscsi_adm_req *req) buf_sz = buf_sz ? buf_sz : ISCSI_NAME_LEN; - buf = calloc(buf_sz, sizeof(char *)); + buf = calloc(buf_sz, sizeof(*buf)); if (!buf) { fprintf(stderr, "Memory allocation failed\n"); return -ENOMEM;