diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-01-18 18:54:18 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-01-18 18:54:18 +0100 |
commit | 78ce67f579730f68b264f99dcf84ff31c92a01f0 (patch) | |
tree | 3823a872803bb93eeda2d6225a9d1e295a679406 | |
parent | 2fb8198c488341a13dbf0b7aaa27e24531c5ec76 (diff) | |
download | libssh-78ce67f579730f68b264f99dcf84ff31c92a01f0.tar.gz libssh-78ce67f579730f68b264f99dcf84ff31c92a01f0.tar.xz libssh-78ce67f579730f68b264f99dcf84ff31c92a01f0.zip |
sftpserver: Use calloc() instead of malloc()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | src/sftpserver.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sftpserver.c b/src/sftpserver.c index 820e9668..b94349f7 100644 --- a/src/sftpserver.c +++ b/src/sftpserver.c @@ -457,11 +457,10 @@ ssh_string sftp_handle_alloc(sftp_session sftp, void *info) { int i; if (sftp->handles == NULL) { - sftp->handles = malloc(sizeof(void *) * SFTP_HANDLES); + sftp->handles = calloc(SFTP_HANDLES, sizeof(void *)); if (sftp->handles == NULL) { return NULL; } - memset(sftp->handles, 0, sizeof(void *) * SFTP_HANDLES); } for (i = 0; i < SFTP_HANDLES; i++) { |