1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-10-31 23:30:25 +03:00

Avoid one malloc by putting the entire handle buffer in the handle struct

at once, use a define for the maximum size length of the handle instead of
'256' in the code.
This commit is contained in:
Daniel Stenberg
2008-12-17 10:45:20 +00:00
parent 2535c5c2ee
commit e26956be72
2 changed files with 7 additions and 13 deletions

View File

@@ -532,12 +532,14 @@ struct _LIBSSH2_PUBLICKEY
unsigned long listFetch_data_len;
};
#define SFTP_HANDLE_MAXLEN 256 /* according to spec! */
struct _LIBSSH2_SFTP_HANDLE
{
LIBSSH2_SFTP *sftp;
LIBSSH2_SFTP_HANDLE *prev, *next;
char *handle;
char handle[SFTP_HANDLE_MAXLEN];
int handle_len;
char handle_type;