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
This commit is contained in:
Bart Van Assche
2015-06-17 00:27:18 +00:00
parent ff2b660264
commit a14df39942

View File

@@ -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;