1
1

sftpserver: Use calloc() instead of malloc()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
Andreas Schneider 2018-01-18 18:54:18 +01:00
родитель 2fb8198c48
Коммит 78ce67f579

Просмотреть файл

@ -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++) {