mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-23 21:51:27 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user