mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
sftpserver: Use calloc() instead of malloc()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -457,11 +457,10 @@ ssh_string sftp_handle_alloc(sftp_session sftp, void *info) {
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (sftp->handles == NULL) {
|
if (sftp->handles == NULL) {
|
||||||
sftp->handles = malloc(sizeof(void *) * SFTP_HANDLES);
|
sftp->handles = calloc(SFTP_HANDLES, sizeof(void *));
|
||||||
if (sftp->handles == NULL) {
|
if (sftp->handles == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memset(sftp->handles, 0, sizeof(void *) * SFTP_HANDLES);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < SFTP_HANDLES; i++) {
|
for (i = 0; i < SFTP_HANDLES; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user